This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle database connection problem

 
David Mbura
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys!
I am trying to configure eclipse with oracle database 11g but I am getting the below exception when i try to test the connection (ping failed).The reason is i cant remember the host name for the database so the url is not correct.How do i find the ip address the database is running on (jdbcracle:thin:@ IPaddress:1521:xe)?Thank you in advance!

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.SQLStateMapping.newSQLException(SQLStateMapping.java:70)

at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:197)

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:525)

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

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

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

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

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

at oracle.eclipse.tools.database.connectivity.db.OracleJDBCConnection.createConn(OracleJDBCConnection.java:199)

at oracle.eclipse.tools.database.connectivity.db.OracleJDBCConnection.createConnection(OracleJDBCConnection.java:149)

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

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

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

at oracle.eclipse.tools.database.connectivity.db.OracleJDBCConnectionFactory.createConnection(OracleJDBCConnectionFactory.java:26)

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

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

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

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

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

... 15 more

 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Mbura wrote: (jdbcracle:thin:@ IPaddress:1521:xe)?Thank you in advance!

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

Your IP address and port number are probably good (the listener is responding), but SID is not known.
SID (System ID)- is a name of your database. SID = xe in your connection string.

Ask your DBA for SID of your database.
If you have access to the DB server, try to locate tnsnames.ora file,
it should be under $ORACLE_HOME/network/admin subdirectory (ORACLE_HOME is an environment variable pointing to the DB subdirectory),
here is an example of this file from my home PC (sid is marked in red):

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

IRKO =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = krokodilko)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = irko)
)
)


 
David Mbura
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kordal,Actually i just found what my database name is,Database name is sparks_database,so that means if try (jdbcracle:thin:@ localhost:1521:sparks_database) should work?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic