no ocijdbc11 in java,java.lang.UnsatisfiedLinkError:java中没有ocijdbc11。 library.path

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

i made a sample console application to test the connection on some client machine

i developed the application on machine that has jdk 6 and used in the project the jar ojdbc6.jar.

the code i am using to connect to database is as follows:

OracleDataSource ods = new OracleDataSource();

String tnsName="Prod";

ods.setURL("jdbc:oracle:oci:/@"+tnsName);

Connection conn = ods.getConnection();

i am trying to run this application from client machine that has the oracle11g installed, and the oracle home is set on path to be: C:\orant\jdk\bin

also the path: C:\orant\bin contains oci.dll and doesn't contain ocijdbc11.dll

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

when trying to run the above code on client machine that is os authenticated to oracle database i am getting 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.(PhysicalConnection.java:

508)

at oracle.jdbc.driver.T2CConnection.(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 can i fix this exception.

解决方案

i was able to make successful os connection to oracle database with jdbc in this post:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值