嘿,我无法使用在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
标签:java,sql,linux,sql-server-2008,jdbc
来源: https://codeday.me/bug/20191001/1839034.html