本文介绍了将Java连接到SQL Anywhere数据库时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将java程序连接到数据库。我在构建路径中有sajdbc4.jar并且之前有效,但是现在我在尝试建立连接时遇到此错误:
I am trying to connect a java program to a database. I have sajdbc4.jar in the build path and it worked before, but now I keep getting this error when I try to make the connection:
有人可以帮帮我吗?在网上找不到任何有关此问题的内容。
Can someome please help me? Can't find anything abount this issue online.
推荐答案
对于Windows,请在您的计算机中找到此文件:
For windows find this file in your computer:
dbjdbc12.dll
对于linux找到这个文件:
For linux find this file:
libdbjdbc12.so
使用命令行选项将此文件的位置放在java.library.path上:
Put the location of this file on the java.library.path either with a command line option:
java -Djava.library.path=DIRECTORYWITHDLL ...
或使用系统代码中的.setProperty:
or using System.setProperty in your code:
System.setProperty("java.library.path","DIRECTORYWITHDLL");
这篇关于将Java连接到SQL Anywhere数据库时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!