为了账号安全,请及时绑定邮箱和手机立即绑定

ORA-12505,TNS:监听器当前不知道连接描述符中给出的SID

/ 猿问

ORA-12505,TNS:监听器当前不知道连接描述符中给出的SID

哔哔one 2019-08-06 15:54:06

ORA-12505,TNS:监听器当前不知道连接描述符中给出的SID

我在Windows 7 64位操作系统中安装了Oracle 11g Express Edition Release 2并试图执行JDBC程序,然后出现以下错误:

java.sql.SQLException: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.jlcindia.jdbc.JDBCUtil.geOracleConnection(JDBCUtil.java:28)
    at Lab3O.main(Lab3O.java:15)Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:385)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
    ... 8 more