Reputation: 291
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
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
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
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
Reputation: 11
This worked for me:
Rename the C:\Users\username\AppData\Roaming\JDeveloper\System
folder
Run the Project from Jdeveloper
Close the Jdeveloper
Rename back the System folder and try running the project and update the mapping in VO
Upvotes: 1
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
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):
It solved it!
Upvotes: 45
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