尝试添加连接eclipse java时oracle连接ping失败了吗?

时间:2017-04-13 23:05:23

标签: java eclipse oracle jdbc oracle11g

我尝试添加连接。

JDBC:预言:瘦:@localhost:1521:XE

由于某种原因它不起作用。错误低于

java.sql.SQLException:侦听器拒绝连接并出现以下错误: ORA-12505,TNS:监听器当前不知道连接描述符

中给出的SID
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:478)

at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:547)

at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:225)

at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:556)

at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.createConnection(JDBCConnection.java:328)

at org.eclipse.datatools.connectivity.DriverConnectionBase.internalCreateConnection(DriverConnectionBase.java:105)

at org.eclipse.datatools.connectivity.DriverConnectionBase.open(DriverConnectionBase.java:54)

at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection.open(JDBCConnection.java:96)

at org.eclipse.datatools.enablement.internal.oracle.JDBCOracleConnectionFactory.createConnection(JDBCOracleConnectionFactory.java:27)

at org.eclipse.datatools.connectivity.internal.ConnectionFactoryProvider.createConnection(ConnectionFactoryProvider.java:83)

at org.eclipse.datatools.connectivity.internal.ConnectionProfile.createConnection(ConnectionProfile.java:359)

at org.eclipse.datatools.connectivity.ui.PingJob.createTestConnection(PingJob.java:76)

at org.eclipse.datatools.connectivity.ui.PingJob.run(PingJob.java:59)

at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

引起:oracle.net.ns.NetException:监听器拒绝连接时出现以下错误: ORA-12505,TNS:监听器当前不知道连接描述符

中给出的SID
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:448)

at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1577)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:353)

... 14 more

1 个答案:

答案 0 :(得分:0)

我的TNS端口号是1522而不是1521.它现在正在成功运行!!!