11g(odbc5.jar)的oci驱动程序可以与10g客户端一起使用吗? [英] can oci driver for 11g (odbc5.jar) work with 10g client?

查看:134
本文介绍了11g(odbc5.jar)的oci驱动程序可以与10g客户端一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的Java应用程序中连接到Oracle9、10和11.客户端将始终存在于将要运行该应用程序的位置,并且我希望该应用程序仅使用用户名,密码和实例(在tnsnames.ora中指定) ).因此,我希望oci驱动程序的连接字符串类型为:jdbc:oracle:oci:@testora .Im使用以下驱动程序:oracle.jdbc.driver.OracleDriver. 我有一个10g的客户端,正在使用jdk1.5.当我从客户端lib路径使用ojdbc14 jar时,应用程序将运行.

I need to connect to Oracle9,10 and 11 in my java application.The client will always be present where the app will be run and I want the app to just work with username,password and instance (specified in tnsnames.ora).Hence I would like oci drivers with a connection string of type : jdbc:oracle:oci:@testora .Im using the driver: oracle.jdbc.driver.OracleDriver. I have a 10g client and am using jdk1.5. When I use the ojdbc14 jar from client lib path the app runs.

但是,如果我使用ojdbc5驱动程序,则该应用程序将失败并显示 线程主"中的异常java.lang.UnsatisfiedLinkError:java中没有ocijdbc11. 库路径

But if I use the ojdbc5 driver then the app fails with Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc11 in java. library.path exception.

我正在寻找的是一种打包单个jar(ojdbc5/ojdbc14)和单个驱动程序的方法,该驱动程序将使用oci驱动程序连接到本地计算机上存在的客户端(9/10/11).我更喜欢的方式.

What im looking for is a way to package a single jar(ojdbc5/ojdbc14) and a single driver which will use oci drivers to connect to the client that is present on local machine(9/10/11).This is the way I would prefer it.

如果无法执行此操作,我可以在unix框中搜索oracle版本,选择正确的jar,然后在调用jar格式的应用程序时在classpath中使用它吗?

If this is not possible can I search the unix box for oracle version,pick up the correct jar and then use it in classpath when invoking the app which is in jar format?

谢谢, 跌倒

推荐答案

java.lang.UnsatisfiedLinkError:java.library.path中没有ocijdbc11

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

这意味着您在Java库路径中缺少DLL(ocijdbc11.dll).确保您具有该DLL并按以下方式启动程序:

This means that you are missing a DLL (ocijdbc11.dll) in the Java library path. Make sure you have that DLL and start your program like this:

java -Djava.library.path=C:\mydirwiththedll com.mypackage.MyProgram

这篇关于11g(odbc5.jar)的oci驱动程序可以与10g客户端一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆