user1615666
user1615666

Reputation: 3451

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

Upvotes: 0

Views: 775

Answers (1)

Mark Rotteveel
Mark Rotteveel

Reputation: 109236

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>

Upvotes: 2

Related Questions