2

I am trying to execute a query using a stored procedure in Eclipse, but I keep getting this error and I am not sure what I am missing to be able to execute the query.

The query works in the actual server the code would be run on, but I am trying to mimic that environment in Eclipse (That being said I know the problem is not in the code, but I am clearly missing a dependency or something? I am not sure).

The error is:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
oracle.jdbc.driver.T2CConnection.t2cSetSessionTimeZone(JLjava/lang/String;)

Here is what I have in my eclipse project:

Libraries:

  • Activation.jar
  • mail.jar
  • ojdbc5.jar
  • rt.jar
  • JRE System Library[J2SE-1.4]

Order and Export:

  • ojdbc5.jar
  • rt.jar
  • Activation.jar
  • mail.jar
  • src
  • JRE System Library[J2SE-1.4]

Also, Compiler info:

  • Java Compiler - J2SE-1.4
  • generated .class file compatibility - 1.2
  • Source compatibility - 1.3

Not sure what other information I should provide..

Thanks!

benRollag
  • 1,219
  • 4
  • 16
  • 21
Dan
  • 707
  • 3
  • 10
  • 18

2 Answers2

2

I remember getting the java.lang.UnsatisfiedLinkError when a dll that should have been on the system path is not present.

In my case there was JAVA code which relied on some native C++ code residing in a dll. Whenever the dll was absent from the classpath the error would be observed.

If this strikes a bell, try adding the required dll as this answer explains.

Update

Try this :

Add C:\app\\product\11.2.0\dbhome_2\jdk\bin to the PATH environment variable.

Also, check this thread for further clues. The OP on this thread solved his problem by doing the above.

Update 2

It seems that a specific version of the driver jars maybe required. Do you have the Oracle Client installed ? Take a look at this (unfortunately, badly translated) thread. Scroll to the bottom to see how that OP fixed this same problem.

Community
  • 1
  • 1
Ashutosh Jindal
  • 18,501
  • 4
  • 62
  • 91
  • I tried setting the path to the jdbc folder in the oracle client on my windows machine.. perhaps I need the server version since I think that is what is installed on the actual server.. I will keep trying different places and see if I can fix it. Thanks for the comment! – Dan Aug 01 '12 at 20:21
  • 1
    I think the problem is I have client version or Oracle and the server has server version or Oracle. I will try to get the necessary files, but it seems like this is a class path issue. thanks a lot for the help! – Dan Aug 01 '12 at 20:52
-2

Problem could also be bacuase of the 'thin' and 'oci' driver declaration. Change the driver name from 'oci' to 'thin' will fix the issue