Java.lang.UnsatisfiedLinkError: no ocijdbc11 in java. library.path

I am trying to make a jdbc oci connection with oracle 11g that uses os authentication

i created a test console application to test the connection on any client machine

I developed the application on a machine with jdk 6 and used the jar ojdbc6.jar in the project .

The code I use to connect to the database is as follows:

OracleDataSource ods = new OracleDataSource();
String tnsName="Prod";
ods.setURL("jdbc:oracle:oci:/@"+tnsName);
Connection conn = ods.getConnection();

I try to run this application from the client machine on which oracle11g is installed, and the oracle house is set to the path: C: \ orant \ jdk \ bin

also the path: C: \ orant \ bin contains oci.dll and does not contain ocijdbc11.dll

the client installed jre7 and does not have jdk.

when I try to run the above code on an authenticated client machine in the oracle database, I get the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.
library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3178)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java
:3174)
        at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:233)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
508)
        at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:133)
        at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtensio
n.java:53)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
        at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSou
rce.java:275)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java
:206)
        at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java
:156)
        at auth.Main.main(Main.java:42)

please advise how I can fix this exception.

+4
source share
5 answers

I was able to make a successful os connection to the oracle database using jdbc in this post:

How to connect to oacle database with os authentication?

0
source

URL- OCI ("jdbc:oracle:oci:/@"+tnsName), . .

URL- , oracle.

"jdbc:oracle:thin:@"+dbServer+":"+port+":"+SID; 
+2

/ usr/share/tomcat/conf/tomcat.conf ld_path:

LD_LIBRARY_PATH="/usr/lib/oracle/11.2/client64/lib:/usr/lib64"
0

u Eclipse Jboss 6.1.0., "main" java.lang.UnsatisfiedLinkError: no ocijdbc11 java. library.path : ocijdbc11.dll oracle\product\11.2.0\client_1\BIN

D:\jboss-6.1.0.Final\Bin\

0

, , JRE 1.6 Java 2. , JRE 1.6 JRE 1.7 JRE 1.8. .

:

  • java.
  • "jre system library", jre 1.6 , , .
  • jre
  • JavaSE-1.8 (jre1.8.0_144), , ok.
  • jre
  • jre1.8 ( jre1.8 , ).
  • "".
  • Click OK.
  • valah! You will find that your code is working.
0
source

All Articles