jdbc oracle 连接串

jdbc.url配置为:

jdbc:oracle:thin:@xxx.xx.xx.xx:1521:orclpdb

报错:

java.sql.SQLException: Listenerrefused the connection with the following error:

ORA-12505, TNS:listener does notcurrently know of SID given in connect descriptor

通过sqlplus是正常的,上网找到:

https://www.cnblogs.com/pcbaby-ch/p/jdbc-connect-oracle12c-pdb-cdb.html

内容为:

4.3  jdbc连接字符串引发问题:
l  jdbc连接cdb数据库时,url兼容2种模式:ü  "jdbc:oracle:thin:@192.168.75.131:1521:oracle12c"ü  "jdbc:oracle:thin:@192.168.75.131:1521/oracle12c"l  jdbc连接pdb数据库时url必须使用:" jdbc:oracle:thin:@192.168.75.131:1521/oracle12c"格式,若使用传统格式" jdbc:oracle:thin:@192.168.75.131:1521:oracle12c"则会报一下错误:java.sql.SQLException: Listenerrefused the connection with the following error:ORA-12505, TNS:listener does notcurrently know of SID given in connect descriptor

看到自己的就是pdb(还没有去看资料什么是pdb),按他说的调整为: jdbc:oracle:thin:@xxx.xx.xx.xx:1521/orclpdb

连接正常

转载于:https://www.cnblogs.com/Wicher-lsl/p/11557276.html


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部