問題描述:
使用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未去深究。