0
votes

I tried to add a connection.

jdbc:oracle:thin:@localhost:1521:xe

it's not working for some reason. The error is below

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: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)

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:448)

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

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

... 14 more
1
Your database SID is not xe, or the SID didn't get registered with the listener.Andreas
Thank you @Andreas I found the issue. My TNS(?) port number was 1522 not 1521. Not sure why.Abdirizak Obsiye
But there is also a listener at 1521, otherwise the error message would have been different, so it seems you have two Oracle installations, and the second installation auto-bumped its port to 1522, because 1521 was already in use.Andreas
hmm, you might be right @Andreas I've been having SSD HDD storage issues lol. Things sometimes install onto my ssd and not my hdd. I might have duplicated an install or something.Abdirizak Obsiye

1 Answers

0
votes

My TNS port number was 1522 not 1521. It is now working successfully!!!