listener does not currently know of SID given in connect descriptor

阅读更多
今天在连接一个oracle读库时出现--- Cause: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Listener refused                                                     the connection with the following error:
                                               ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
                                               The Connection descriptor used by the client was:
                                                223.203.208.109:1521:racstandby

                              这样的错误,可是PL/SQL是可以连接的,怎么会出现PL/SQL可以连接而程序不能连,网上许多人说这个错误是SID不对,但是对于我这里就不一样,毕竟ORACLE可以连呀,后来在想想是不是xml配置问题,原先配置如下:

                                 
jdbc:oracle:thin:@223.203.208.109:1521:racstandby
       




现在修改成 jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=223.203.208.109)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=racstandby)))



参考: https://blog.csdn.net/qianlidongqll1/article/details/46691829

JAVA连接ORACLE
https://www.cnblogs.com/1187163927ch/p/8669859.html

你可能感兴趣的:(listener does not currently know of SID given in connect descriptor)