Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm created a .jar of my java application, and when i'm try to run that .jar from cmd, i get an error.

I've been searching and found many examples, but no one work's for me. I set the java.library.path to the directory ‘sqljdbc_auth.dll’ like I saw here but the error continuous.

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

I Run my java application with command : java -Djava.library.path= "my dll path" and give this:

PS C:UsersUser> java -Djava.library.path="C:UsersUserDesktopMicrosoft JDBC Driver 4.0 for SQL Serversqljdbc
_4.0ptbauthx64"
Error: Could not find or load main class .library.path=C:UsersUserDesktopMicrosoft JDBC Driver 4.0 for SQL Server
sqljdbc_4.0ptbauthx64

I really dont no how solve this. I've been searching a lot of time, but nothing works. Please someone help me.

THANKS

 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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
342 views
Welcome To Ask or Share your Answers For Others

1 Answer

Got it working...

1) Added .dll and .jar in Java/JDK/bin

2) Added .jar in applications/lib

3) Added .dll in windows/system32

add the java/jdk../bin and windows/system32 in "Path" system environment.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...