`

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配置问题,原先配置如下:

                                  <property name="url">
<value>jdbc:oracle:thin:@223.203.208.109:1521:racstandby</value>
        </property>



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


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

JAVA连接ORACLE
https://www.cnblogs.com/1187163927ch/p/8669859.html
分享到:
评论

相关推荐

    Oracle数据库使用sqlplus时的连接错误与方向键乱码解决

    错误提示“ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)”表明监听器并不知道在连接描述符中给出的SID。这通常是因为客户端与服务器之间的...

    Oracle SQL Developer连接报错(ORA-12505)的解决方案(两种)

    之前用PL/SQL DEVELOPER和SQLPLUS 登录数据库都没有问题,就是应用程序通过JDBC连接Oracle时无法成功连接,出现ORA-12505错误listener does not currently know of SID given in connect descriptor

    django连接oracle的方法 Windows环境

    当配置 Django 的 setting.py 文件中的数据库连接参数时,可能会遇到 ORA-12505 错误:“TNS:listener does not currently know of SID given in connect descriptor”。这通常是由于配置文件中指定的服务名 ...

    oracle适配器连接不上的解决办法

    racle 的Developer连接不上报错:listener does not currently know of SID given in connect descriptor,如何解决呢?下面小编给大家分享oracle适配器连接不上的解决办法,需要的朋友可以参考下

    java基于JDBC连接Oracle 11g Release2实例分析

    如果遇到“Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor”的异常,这通常是因为连接字符串不正确或者数据库...

Global site tag (gtag.js) - Google Analytics