简体   繁体   中英

Linux access MSSQL failed

My Java application in Linux was trying to access an MSSQL database and failed. Keytab, security login, and krb5 all are defined. driver is sqljdbc4-2.0.jar . The error message still looking for Windows Authentication.

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

Version 2.0 of the Microsoft SQL Server JDBC driver is pretty old, support for pure Java Kerberos authentication was only added in version 4.0. See Using Kerberos Integrated Authentication to Connect to SQL Server :

Beginning in Microsoft JDBC Driver 4.0 for SQL Server, an application can use the authenticationScheme connection property to indicate that it wants to connect to a database using Kerberos integrated authentication using the pure Java Kerberos implementation

Either download version 6.0 from Microsoft , or get version 6.1 from maven using

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM