dll missing in JDBC

后端 未结 9 910
Happy的楠姐
Happy的楠姐 2020-11-29 07:15

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

com.microsoft.sqlserver.jdbc.AuthenticationJNI 
WARNING: Failed to load the         


        
相关标签:
9条回答
  • 2020-11-29 08:08

    You have to make sure your DLL is in the classpath.

    One such way to do so is to put the path to the DLL in PATH environment variable.

    Other option is to add it to the VM arguments in the variable LD_LIBRARY_PATH, like this:

    java -Djava.library.path=/path/to/my/dll -cp /my/classpath/goes/here MainClass

    0 讨论(0)
  • 2020-11-29 08:11

    For easy fix follow these steps:

    1. goto: https://docs.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

    0 讨论(0)
  • 2020-11-29 08:16

    You need to set a -D system property called java.library.path that points at the directory containing the sqljdbc_auth.dll.

    0 讨论(0)
提交回复
热议问题