Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dll missing in JDBC

I am currently working with SQL in Java. Recently I got this error:

com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path

This happens when I add the parameter integratedSecurity=true; in the connection String. The error message clearly says that sqljdbc_auth.dll is missing, so I tried to put the dll in the same path as I keep sqljdbc4.jar.

However, this doesn't work, so I wanted to know how I actually can add this dll to my build path? Is there a special way to do it?

like image 704
muffin Avatar asked Jun 24 '13 13:06

muffin


3 Answers

keep sqljdbc_auth.dll in your windows/system32 folder and it will work.Download sqljdbc driver from this link Unzip it and you will find sqljdbc_auth.dll.Now keep the sqljdbc_auth.dll inside system32 folder and run your program

like image 109
SpringLearner Avatar answered Oct 17 '22 05:10

SpringLearner


For easy fix follow these steps:

  1. goto: https://learn.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url#Connectingintegrated
  2. Download the JDBC file and extract to your preferred location
  3. open the auth folder matching your OS x64 or x86
  4. copy sqljdbc_auth.dll file
  5. paste in: C:\Program Files\Java\jdk_version\bin

restart either eclipse or netbeans

like image 11
jfindley Avatar answered Oct 17 '22 04:10

jfindley


Alright guys, I found it out! I didn't really need to change the java.library.path but the "Native library location" of sqljdbc.jar

This is the best answer I could find: https://stackoverflow.com/a/958074/2000342

It works now, thanks for the support!

like image 10
muffin Avatar answered Oct 17 '22 03:10

muffin