I/O 错误:SSO 失败:未加载本机 SSPI 库
我正在尝试运行以下代码:
import java.sql.DriverManager;
public class Connect {
public static void main(String[] args){
try{
String databaseDriver = "net.sourceforge.jtds.jdbc.Driver";
Class.forName(databaseDriver);
}
catch (Exception e) {
e.printStackTrace();
}
try{
String url = "jdbc:jtds:sqlserver://BHX:1433/Forecast;instance=SQLEPXRESS";
java.sql.Connection con = DriverManager.getConnection(url);
System.out.println("Connection");
}
catch (Exception e){
e.printStackTrace();
}
}
}
我的 SQL 服务器正在计算机 BHX 上的端口 1433 上运行。
我收到的错误消息如下:
java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:615)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:352)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:185)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Connect.main(Connect.java:14)
Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1893)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:588)
... 6 more
我已经阅读了为什么这种情况通常会发生,并在这里发现了类似的问题,但这似乎不起作用。运行代码时,我已包含以下参数以查找 SSO 文件:
-Djava.library.path=/Tester/jdbc/x64/SSO
这是我的文件的结构
**Tester**
*src*
default package
Connect.java
*JRE System Library*
*jdbc*
conf
html
IA64
x64
SSO
ntlmauth.dll
x86
你能发现任何错误吗?