no sqljdbc_auth in java.library.path

Viewed 128320

I have a Java EE Web Application which connects to a SQL Server 2008 instance. I don't have any problem connecting and retrieving to all my tables, except for one of them. The error in the Tomcat log is:

WARNING: Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path

8 Answers

I had to use windows authentication and I tried every suggested solution out there but with no success till I changed the name of the auth file as follows:

old-name: mssql-jdbc_auth-10.2.0.x64.dll

new-name: sqljdbc_auth.dll

And then it worked!

I looked up for this case to understand it more, apparently for Windows operating systems, the driver looks for sqljdbc_auth.dll by default.

Here is a useful link I've found:

https://docs.microsoft.com/en-us/sql/connect/jdbc/feature-dependencies-of-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15

To resolve I did the following:

  1. Copied sqljdbc_auth.dll into dir: C:\Windows\System32
  2. Restarted my application

I resolved the issue by:

  1. Upgrading com.microsoft.sqlserver from 6.1.0.jre8 to 10.1.0.jre8-preview:

    <dependency>
         <groupId>com.microsoft.sqlserver</groupId>
         <artifactId>mssql-jdbc</artifactId>
         <version>10.1.0.jre8-preview</version>
    </dependency>
    
  2. Adding missing dependency:

     <dependency>
         <groupId>net.sourceforge.jtds</groupId>
         <artifactId>jtds</artifactId>
         <version>1.3.1</version>
     </dependency>
    
  3. Using the following jdbc connection:

jdbc:sqlserver://;authenticationScheme=NTLM;integratedSecurity=true;domain=;databasename=;encrypt=true;trustServerCertificate=true;user=;password=

Related