jdbc連接oracle數據庫出現ORA-12505錯誤

問題描述:

使用jdbc連接oracle時報錯:

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was:

10.12.162.84:1521:xxxx

解決方法:

jdbc:oracle:thin:@//<host>:<port>/<service_name>
Example: jdbc:oracle:thin:@//192.168.2.1:1521/XE

注意不要丟掉了@ 以及端口號後面是服務名而並非數據庫名。具體緣由LZ未去深究。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章