我无法使用Windows身份验证连接到SQL Server。 这是抛出的异常:
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:1889)
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:587)
... 35 more
这是Spring配置:
@Bean
public DataSource dataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("net.sourceforge.jtds.jdbc.Driver");
dataSource.setUrl(...);
return dataSource;
}
定义了以下VM参数:
-Djava.library.path=C:\x64\SSO
这指向 ntlmauth.dll (来自 jtds-1.3.1-dist.zip )
pom中定义了以下依赖项:
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>com.springsource.net.sourceforge.jtds</artifactId>
<version>1.2.2</version>
</dependency>
显然遗漏了一些东西 - 非常感谢任何帮助!