java. lang.UnsatisfiedLinkError:java. library. There is no sqljdbc in path_ auth

I created a Java application Jar when I try to run from CMD Jar, I received an error

I've been looking for and finding many examples, but no one works for me I will Java library. Set path to the directory 'sqljdbc'_ auth. DLL ', as I see here, but the errors are continuous

http://www.linglom.com/images/howto/netbeans/sqlserver/part3/8.png

I run my java application with the command: Java - DJava library. Path = "my DLL path" and give:

PS C:\Users\User> java -Djava.library.path="C:\Users\User\Desktop\Microsoft JDBC Driver 4.0 for sql Server\sqljdbc
_4.0\ptb\auth\x64"
Error: Could not find or load main class .library.path=C:\Users\User\Desktop\Microsoft JDBC Driver 4.0 for sql Server
\sqljdbc_4.0\ptb\auth\x64

I really don't know how to solve this problem I've been looking for a lot of time, but it doesn't work Please have someone help me

thank you

WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path
com.microsoft.sqlserver.jdbc.sqlServerException: This driver is not configured for integrat
ectionId:0481a2ee-4ac4-4fd3-89cd-58aad1696fe4
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.terminate(sqlServerConnection.j
        at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<init>(AuthenticationJNI.java:60)
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.logon(sqlServerConnection.java:
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.access$000(sqlServerConnection.
        at com.microsoft.sqlserver.jdbc.sqlServerConnection$logonCommand.doExecute(sqlServe
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.executeCommand(sqlServerConnect
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.connectHelper(sqlServerConnecti
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.login(sqlServerConnection.java:
        at com.microsoft.sqlserver.jdbc.sqlServerConnection.connect(sqlServerConnection.jav
        at com.microsoft.sqlserver.jdbc.sqlServerDriver.connect(sqlServerDriver.java:1012)
        at java.sql.DriverManager.getConnection(UnkNown Source)
        at java.sql.DriverManager.getConnection(UnkNown Source)
        at test.database.Conection.getConexao(Conection.java:41)
        at test.forms.jTLogin.<init>(jTLogin.java:71)
        at test.forms.jTLogin$4.run(jTLogin.java:448)
        at java.awt.event.InvocationEvent.dispatch(UnkNown Source)
        at java.awt.EventQueue.dispatchEventImpl(UnkNown Source)
        at java.awt.EventQueue.access$400(UnkNown Source)
        at java.awt.EventQueue$3.run(UnkNown Source)
        at java.awt.EventQueue$3.run(UnkNown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(UnkNown Source)
        at java.awt.EventQueue.dispatchEvent(UnkNown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(UnkNown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(UnkNown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(UnkNown Source)
        at java.awt.EventDispatchThread.pumpEvents(UnkNown Source)
        at java.awt.EventDispatchThread.pumpEvents(UnkNown Source)
        at java.awt.EventDispatchThread.run(UnkNown Source)
Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path
        at java.lang.ClassLoader.loadLibrary(UnkNown Source)
        at java.lang.Runtime.loadLibrary0(UnkNown Source)
        at java.lang.System.loadLibrary(UnkNown Source)
        at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:3
        ... 28 more

Solution

It's done

1) Added in Java / JDK / bin DLL and jar

2) Added in applications / lib jar

3) Added in Windows / system32 dll

Add Java / JDK in the "path" system environment/ Bin and windows / system32

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>