Exception while creating a DataBase Connection (Unix)

Hello Friends,

I am Trying to create a DataBase Connection using OCI in java on UNIX Platform, but it gives an error message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path

at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1542)

at java.lang.Runtime.loadLibrary0(Runtime.java:795)

at java.lang.System.loadLibrary(System.java:834)

at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java)

at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java)

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

at java.sql.DriverManager.getConnection(DriverManager.java:512)

at java.sql.DriverManager.getConnection(DriverManager.java:171)

at TestDBConn.<init>(TestDBConn.java:16)

at TestDBConn.main(TestDBConn.java:35)

I have also checked my environment variables which seems to be correct, just have a look:

$ echo $ORACLE_HOME

/oratest/ora/proddb/9.2.0

$ echo $CLASSPATH

/oratest/ora/proddb/9.2.0/jdbc/lib

$ echo $LD_LIBRARY_PATH

/oratest/ora/proddb/9.2.0/lib

Please help in solving this problem...

Thanks in Avance,

Ankur

[1312 byte] By [AnkurBhatiaa] at [2007-10-3 5:11:20]
# 1

that CLASSPATH variable probably needs the name to some jarfile still. Adding a directory containg jar files to your CLASSPATH will not help, you have to add the jarfiles themselves to CLASSPATH.

I could be wrong, and Oracle has delivered this driver in "directory" and not jar format, but I doubt it.

masijade.a at 2007-7-14 23:17:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Hi dearI have set the classpath for the JAR file also but the problem is still same. Regards,Ankur
AnkurBhatiaa at 2007-7-14 23:17:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

Okay, I see. CLASSPATH did not matter, it is looking for a local librbary. LD_LIBRARY_PATH is the variable that matters here. It looks okay, so the only thing I can tell you is to make sure a library (.so) file exists in the lib directory specified with ocijdbc9 in the filename (probably libocijdb9.so). The only other thing is the "stupid" question, which is, have you exported your variables (i.e. export LD_LIBRARY_PATH).

masijade.a at 2007-7-14 23:17:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
Yes dear, please have a look there are three files under LD_LIBRARY_PATH:1. libocijdbc9.a2. libocijdbc9.sl3. libocijdbcst9.aPlease note there is .sl file rather than .so filePlease provide me the solution...Regards,Ankur
AnkurBhatiaa at 2007-7-14 23:17:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
can anyone help me in solving this problemThanks in advance,ankur
AnkurBhatiaa at 2007-7-14 23:17:44 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...