+-
java – 使用integratedSecurity(Windows身份验证)通过JDBC从Linux连接到SQL Server?
嘿,我无法使用在 Linux上运行的Java代码连接到SQL Server.

如果我设置integratedSecurity = true,则java代码失败并出现以下错误:

WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:b030b480-453d-4007-8151-a552150f74cd

这是有道理的,因为Linux上没有sqljdbc.dll文件.

但是如果我设置integratedSecurity = false,那么我会收到以下错误:

 com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'IT_DEV_USER'.

那么有谁知道如何连接到SQL Server并将integratedSecurity设置为false? (请注意,当integratedSecurity设置为false时,我甚至无法在Windows上运行Java代码时进行连接.)

如果没有,有什么办法可以让我在Linux上使用integratedSecurity吗?

最佳答案
如果要使用集成安全性并使用JDBC Driver 4.0或更高版本,则在jdbc连接字符串中添加以下内容.

integratedSecurity=true;authenticationScheme=JavaKerberos

更多信息:http://blogs.msdn.com/b/psssql/archive/2015/01/09/jdbc-this-driver-is-not-configured-for-integrated-authentication.aspx

点击查看更多相关文章

转载注明原文:java – 使用integratedSecurity(Windows身份验证)通过JDBC从Linux连接到SQL Server? - 乐贴网