java.library.path 中没有 ocijdbc12
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27445610/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
no ocijdbc12 in java.library.path
提问by Darshil Shah
I am trying to make a connection to oracle through java program using OCI driver.
我正在尝试使用 OCI 驱动程序通过 java 程序连接到 oracle。
Following is the configuration.
以下是配置。
- Windows 7, 32 bit.
- JDK 1.7
- Oracle client 11g R2.
- Windows 7,32 位。
- JDK 1.7
- Oracle 客户端 11g R2。
ojdbc7.jar
in the class path of my standalone application.
But I am getting following exception:
ojdbc7.jar
在我的独立应用程序的类路径中。但我收到以下异常:
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.
请帮我解决这个问题。
回答by mic.sca
To use the oracle OCI driver you should have the relevant dlls in your java library path.
要使用 oracle OCI 驱动程序,您的 java 库路径中应该有相关的 dll。
https://docs.oracle.com/cd/B28359_01/java.111/b31224/instclnt.htm#CHDIHGEF
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.
确保参考正确的版本,包括 32/64 位和版本号。
回答by lyy
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):
我遇到了同样的问题,它只是我*.ora
文件的外部文件夹,不再存在,我通过(菜单导航)再次指向它:
- Tools
- Preferences
- Database
- Advanced
- tnsnames directory
- Advanced
- Database
- Preferences
- 工具
- 喜好
- 数据库
- 先进的
- tnsnames 目录
- 先进的
- 数据库
- 喜好
It solved it!
它解决了它!
回答by anil1890
It has been resolved by setting Oracle client
已经通过设置Oracle客户端解决了
Tools -> Preference -> Database -> Advanced -> Use Oracle client -> (choose path of oracle client)
工具->首选项->数据库->高级->使用Oracle客户端->(选择oracle客户端的路径)
ex: Instant Client: file:/C:/Oracle/product/11.2.0/client_3/
例如:即时客户端: file:/C:/Oracle/product/11.2.0/client_3/
回答by user1307840
For JDeveloper 12c, if you come across this issue set up an environment variable referring to ojdbc jar"
对于 JDeveloper 12c,如果您遇到此问题,请设置一个引用 ojdbc jar 的环境变量”
-J-Djdbc.library=<PATH>\ojdbc6.jar"
回答by starko
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
我补充一下,oracle express安装后出现的问题,期间出现错误,安装未完成
回答by Amol Shinde
This worked for me:
这对我有用:
Rename the
C:\Users\username\AppData\Roaming\JDeveloper\System
folderRun the Project from Jdeveloper
Close the Jdeveloper
Rename back the System folder and try running the project and update the mapping in VO
重命名
C:\Users\username\AppData\Roaming\JDeveloper\System
文件夹从 Jdeveloper 运行项目
关闭 Jdeveloper
重命名系统文件夹并尝试运行项目并更新 VO 中的映射
回答by Piotr Kepka
The error message may be misleading - especially when your application is correctly configured (with all jars in place etc.)
错误消息可能具有误导性 - 特别是当您的应用程序配置正确时(所有 jars 都已就位等)
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.
检查tnsnames.ora
文件是否包含您尝试连接的数据库的定义。如果没有,请添加它并重新启动应用程序。