jdbc oracle 连接串
生活随笔
收集整理的這篇文章主要介紹了
jdbc oracle 连接串
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
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是正常的,上網(wǎng)找到:
https://www.cnblogs.com/pcbaby-ch/p/jdbc-connect-oracle12c-pdb-cdb.html
內(nèi)容為:
4.3 jdbc連接字符串引發(fā)問題: l jdbc連接cdb數(shù)據(jù)庫時,url兼容2種模式:ü "jdbc:oracle:thin:@192.168.75.131:1521:oracle12c"ü "jdbc:oracle:thin:@192.168.75.131:1521/oracle12c"l jdbc連接pdb數(shù)據(jù)庫時url必須使用:" jdbc:oracle:thin:@192.168.75.131:1521/oracle12c"格式,若使用傳統(tǒng)格式" 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),按他說的調(diào)整為:?jdbc:oracle:thin:@xxx.xx.xx.xx:1521/orclpdb
連接正常
轉(zhuǎn)載于:https://www.cnblogs.com/Wicher-lsl/p/11557276.html
總結(jié)
以上是生活随笔為你收集整理的jdbc oracle 连接串的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Robo 3T SQL
- 下一篇: 【模板】 最小生成树