2016-11-25 35 views
0

我在Linux中的Java應用程序試圖訪問MSSQL數據庫並失敗。 Keytab,安全登錄和krb5全部被定義。驅動程序是sqljdbc4-2.0.jar。該錯誤消息仍在尋找Windows身份驗證。Linux訪問MSSQL失敗

driver:com.microsoft.sqlserver.jdbc.SQLServerDriver 
url:jdbc:sqlserver://AAA.com:10501;instanceName=BBB_DEV;integratedSecurity=true;authenticationScheme=JavaKerberos 
Nov 25, 2016 3:42:26 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit> 
WARNING: Failed to load the sqljdbc_auth.dll 
+0

爲什麼投入得到行家6.1版本?任何解決方案 – user1615666

+1

您的連接字符串說明了這一切,如果不是其他任何內容 - 「integratedSecurity = true」用於SQL Server上的Windows身份驗證。 –

+0

@ N00bPr0grammer不,它不適用於最新的JDBC驅動程序,請參閱https://msdn.microsoft.com/en-us/library/gg558122(v=sql.110).aspx –

回答

2

Microsoft SQL Server JDBC驅動程序的版本2.0相當陳舊,僅在版本4.0中添加了對純Java Kerberos身份驗證的支持。見Using Kerberos Integrated Authentication to Connect to SQL Server

開始在微軟的JDBC驅動程序4.0 SQL Server中,應用程序可以使用authenticationScheme連接屬性表明,它希望通過使用純Java Kerberos實現

的Kerberos集成身份驗證連接到數據庫

無論download version 6.0 from Microsoft,或使用

<dependency> 
    <groupId>com.microsoft.sqlserver</groupId> 
    <artifactId>mssql-jdbc</artifactId> 
    <version>6.1.0.jre8</version> 
</dependency>