Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no ocijdbc12 in java.library.path

I am trying to make a connection to oracle through java program using OCI driver.

Following is the configuration.

  • Windows 7, 32 bit.
  • JDK 1.7
  • Oracle client 11g R2.

ojdbc7.jar in the class path of my standalone application. But I am getting following exception:

Exception in thread 'main' java.lang.UnsatisfiedLinkError: no ocijdbc12 in java.library.path

I tried connection using thin driver. For thin driver it is Connection Succeeded. I googled but was not able to figure out the solution.

Please help me solve this problem.

like image 990
Darshil Shah Avatar asked Dec 12 '14 14:12

Darshil Shah


People also ask

Where is Java library PATH?

Go to Project properties->Java Build Path->Source. You'll find a list of source-folders. Each entry under the the Source tab has Native library locations.

What is Djava library PATH?

java. library. path is a System property, which is used by Java programming language, mostly JVM, to search native libraries, required by a project.

How do I change the Java library PATH in SQL Developer?

If you open up SQL Developer, you can navigate to Tools -> Preferences -> Database -> Third Party JDBC Drivers and click Add Entry . Open to /usr/lib/oracle/12.2/client64 and click on lib . It will hilight it, and then you can click select to add it to the list.


2 Answers

I had the same issue, it was just the external folder of the my *.ora files which was not there any more, I pointed to it again via (menu navigation):

  • Tools
    • Preferences
      • Database
        • Advanced
          • tnsnames directory

It solved it!

like image 60
lyy Avatar answered Oct 01 '22 02:10

lyy


To use the oracle OCI driver you should have the relevant dlls in your java library path.

https://docs.oracle.com/cd/B28359_01/java.111/b31224/instclnt.htm#CHDIHGEF

Make sure to reference the correct release, both in term of 32/64 bit and version number.

like image 32
mic.sca Avatar answered Oct 01 '22 02:10

mic.sca