Unable to connect Oracle database: JDBC issue [message #247044] |
Sat, 23 June 2007 02:43 |
SenthilGugan
Messages: 9 Registered: June 2007
|
Junior Member |
|
|
Hi all,
I have successfully installed the Oracle 10g Express edition in my Lniux10.2 suse OS, after that I have set the ORACLE_HOME, ORACLE_SID and the PATH environment variables as follows.
exportPATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server.
ORACLE_SID=XE
Now I have this problem.
I am unable to connect the oracle database through Jdbc.
when I run the Jdbc java program, it gives me,
manickam:~/workspace # java MainClass
error: failed to create a connection object.
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:database
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at MainClass.getConnection(MainClass.java:18)
at MainClass.main(MainClass.java:26)
Looking forward to a solution,
Thanks in advance,
Senthil.
|
|
|
|
|