aspose file tools*
The moose likes JDBC and the fly likes error while connecting with oracle 9 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "error while connecting with oracle 9" Watch "error while connecting with oracle 9" New topic
Author

error while connecting with oracle 9

ravindra patil
Ranch Hand

Joined: Sep 01, 2006
Posts: 214
i am getting following error

"
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
The Connection descriptor used by the client was:
localhost:1521:mydsn

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.j ................


please give the solution
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Check if listener is created & running

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Chris Hendy
Ranch Hand

Joined: Mar 04, 2006
Posts: 98
I think the listener must be running for it to refuse the connection.

Looking at your connect string, localhost indicates a database running on your local machine, and mydsn is the SID (System identifier) of the specific database.

So, do you have an Oracle database called mydsn installed and running on your local machine?
Martin Simons
Ranch Hand

Joined: Mar 02, 2006
Posts: 196
Originally posted by Chris Hendy:
So, do you have an Oracle database called mydsn installed and running on your local machine?


And a listener configured for it?
 
Don't get me started about those stupid light bulbs.
 
subject: error while connecting with oracle 9
 
Similar Threads
Problem getting DB Connection from Datasource in OpenEJB
Oracle database connection problem
Software caused connection abort: recv failed
java.sql.SQLException: Io exception: Got minus one from a read call
Could not create connection; - nested throwable: