oracle - java.lang.UnsatisfiedLinkError: no ocijdbc11 in java. library.path -


i trying make jdbc oci connection oracle 11g uses os authentication

i made sample console application test connection on client machine

i developed application on machine has jdk 6 , used in project jar ojdbc6.jar.

the code using connect database follows:

oracledatasource ods = new oracledatasource(); string tnsname="prod"; ods.seturl("jdbc:oracle:oci:/@"+tnsname); connection conn = ods.getconnection(); 

i trying run application client machine has oracle11g installed, , oracle home set on path be: c:\orant\jdk\bin

also path: c:\orant\bin contains oci.dll , doesn't contain ocijdbc11.dll

the client has jre7 installed , doesn't have jdk.

when trying run above code on client machine os authenticated oracle database getting following exception:

exception in thread "main" java.lang.unsatisfiedlinkerror: no ocijdbc11 in java. library.path         @ java.lang.classloader.loadlibrary(unknown source)         @ java.lang.runtime.loadlibrary0(unknown source)         @ java.lang.system.loadlibrary(unknown source)         @ oracle.jdbc.driver.t2cconnection$1.run(t2cconnection.java:3178)         @ java.security.accesscontroller.doprivileged(native method)         @ oracle.jdbc.driver.t2cconnection.loadnativelibrary(t2cconnection.java :3174)         @ oracle.jdbc.driver.t2cconnection.logon(t2cconnection.java:233)         @ oracle.jdbc.driver.physicalconnection.<init>(physicalconnection.java: 508)         @ oracle.jdbc.driver.t2cconnection.<init>(t2cconnection.java:133)         @ oracle.jdbc.driver.t2cdriverextension.getconnection(t2cdriverextensio n.java:53)         @ oracle.jdbc.driver.oracledriver.connect(oracledriver.java:510)         @ oracle.jdbc.pool.oracledatasource.getphysicalconnection(oracledatasou rce.java:275)         @ oracle.jdbc.pool.oracledatasource.getconnection(oracledatasource.java :206)         @ oracle.jdbc.pool.oracledatasource.getconnection(oracledatasource.java :156)         @ auth.main.main(main.java:42) 

please advise how can fix exception.

if use oci url("jdbc:oracle:oci:/@"+tnsname) need oracle client libraries on classpath. need have oracle client on machine.

but if use thin driver , specify url following, don't need oracle client.

"jdbc:oracle:thin:@"+dbserver+":"+port+":"+sid;  

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -