Darshil Shah
Darshil Shah

Reputation: 291

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.

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.

Upvotes: 29

Views: 119458

Answers (7)

Piotr Kepka
Piotr Kepka

Reputation: 337

The error message may be misleading - especially when your application is correctly configured (with all jars in place etc.)

Check the tnsnames.ora file if it contains the definition for the database you try to connect to. If not, add it and restart the application.

-- EDIT --

If the definition is there but you can't see any TNSes, check if the syntax is fine. One bracket too much and SQL Developer will ignore the whole file silently...

Upvotes: 0

anil1890
anil1890

Reputation: 31

It has been resolved by setting Oracle client

Tools -> Preference -> Database -> Advanced -> Use Oracle client -> (choose path of oracle client)

ex: Instant Client: file:/C:/Oracle/product/11.2.0/client_3/

Upvotes: 3

user1307840
user1307840

Reputation: 1

For JDeveloper 12c, if you come across this issue set up an environment variable referring to ojdbc jar"

-J-Djdbc.library=<PATH>\ojdbc6.jar"

Upvotes: 0

Amol Shinde
Amol Shinde

Reputation: 11

This worked for me:

  1. Rename the C:\Users\username\AppData\Roaming\JDeveloper\System folder

  2. Run the Project from Jdeveloper

  3. Close the Jdeveloper

  4. Rename back the System folder and try running the project and update the mapping in VO

Upvotes: 1

starko
starko

Reputation: 1149

I had a similar situation.

The solution turned out to be to enter the connection property and from this level to reconnect.

I will add that the problem appeared after the installation of oracle express during which an error occurred and the installation was not completed

Upvotes: 0

lyy
lyy

Reputation: 591

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!

Upvotes: 45

mic.sca
mic.sca

Reputation: 1696

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.

Upvotes: 4

Related Questions