ful*_*ead 13 java sql linux jdbc sql-server-2008
嘿,我无法使用在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
Run Code Online (Sandbox Code Playgroud)
这是有道理的,因为sqljdbc.dll
Linux 上没有文件.
但如果我设置integratedSecurity=false
,那么我得到以下错误:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'IT_DEV_USER'.
Run Code Online (Sandbox Code Playgroud)
那么有谁知道如何连接到SQL Server integratedSecurity
设置为false?(注意,当Java代码在Windows上运行时,我甚至无法连接,当integratedSecurity
设置为false时.)
如果没有,有什么方法可以integratedSecurity
在Linux上工作吗?
小智 5
如果要使用集成安全性并使用JDBC Driver 4.0或更高版本,请在jdbc连接字符串中添加以下内容。
integratedSecurity=true;authenticationScheme=JavaKerberos
Run Code Online (Sandbox Code Playgroud)
详细信息:http : //blogs.msdn.com/b/psssql/archive/2015/01/09/jdbc-this-driver-is-not-configured-for-integrated-authentication.aspx
小智 -3
您无法使用 Linux 系统中的集成安全功能,因为它与 Windows 系统绑定并使用您的 Windows 身份验证。但是,如果您在 SQL Server 上同时启用 SQL Server 和 Windows 身份验证模式,那么您可以创建登录名、映射到相应的数据库并在 Linux 中的 java 中使用它。
要启用 SQL Server 身份验证:
归档时间: |
|
查看次数: |
14940 次 |
最近记录: |