This discussion is archived
2 Replies Latest reply: Jun 26, 2013 5:32 AM by Dattaprasad RSS

java.lang.UnsatisfiedLinkError: oracle.jdbc.driver.T2CConnection.getLibrary

765609 Newbie
Currently Being Moderated
Hi,

I am trying to use OCI driver for my Java application running in a linux machine to connect to the oracle 11g database.

My Java version is :

java version "1.6.0_32"
Java(TM) SE Runtime Environment (build 1.6.0_32-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode)

I also installed Oracle instant client for 64 bit.
LD_LIBRARY_PATH and TNS_ADMIN paths are set.

My Java code has ojdbc6.jar as a dependency and I am trying to connect like this

Connection conn = DriverManager.getConnection("jdbc:oracle:oci:@<Service name from tns>", "username", "password");


When I run the program, I am getting

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber()I
at oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber(Native Method)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:7544)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:7539)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:419)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:557)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:159)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:64)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:556)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)


I looked over many threads,but could not find a proper solution.What am I missing?

Any help on this is appreciated.

Regards
Sathish

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points