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未去深究。

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