With the popularity of Java language, JDBC is now perhaps the most commonly used API to access databases. Oracle is one of the premium databases of the world. This book is about accessing and manipulating data in Oracle using JDBC, with a focus on p
今天生产上项目启动访问 一个数据库的时候,出现了
ORA-12505, TNS:listener does not currently know of SID given in connect desc .
后面看了下,我的数据库配置为:
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:158.58.88.102:1521:eskdb
username=root
password=aaa111
然后看了下
使用jdbc连接oracle时url有三种格式
格式一: Oracle JDBC Thin using an SID:
jdbc:oracle:thin:host:port:SID
Example: jdbc:oracle:thin:localhost:1521:orcl
这种格式是最简单也是用得最多的
你的oracle的sid可以通过一下指令获得:
sqlplus / as sysdba
select value from v$parameter where name='instanc