File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes  no sqljdbc_auth in java.library.path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark " no sqljdbc_auth in java.library.path" Watch " no sqljdbc_auth in java.library.path" New topic

no sqljdbc_auth in java.library.path

kevind duff

Joined: Jul 07, 2011
Posts: 23
Hello Kind Java Dudes and Dudettes:

I have a a small issue. I guess my first problem is that I am using MS-SQL as my back end, but that was not my call.
We are also using integrated authentication on MS-SQl server.

Please note I have this program working under Eclipse.

I am running a simple batch file to setup the run for this java program.
This the output I get at the command line:

-Xmx512m -Dlog4j.configuration=log4jproperties -Djava.library.path=\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\ms_sql_jdbc_3.0.1\sqljdbc_3.0\enu\sqljdbc_auth.dll
-classpath "\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\Restlet Framework\Edition Java SE\2.0.8\lib\org.restlet.jar";
"\\fileprint-01\Data\Company\WRInvest\IT\code_base\third_party_software\Restlet Framework\Edition Java SE\2.0.8\lib\";


0 [main] INFO IB_Post_DocB - Property file: \\fileprint-01\Data\Company\WRInvest\IT\code_base\qa\investor_bridge\IB_Rest\con
fig_files\IBRest.prop has been read

I get the dump below from the code.

So my questions are: Am I setting the java.library.path correctly?
This integrated MS-SQL authentication caused me a problem under Eclipse also , but after I placed sqljdbc_auth.dll
in C:\Windows\System32 the problem went away. So there is another question why is the JVM not finding
sqljdbc_auth.dll in the Windows Path.

Your kind assistance is requested.



0 [main] INFO IB_Post_DocB - Property file: \\fileprint-01\Data\Company\WRInvest\IT\code_base\qa\investor_bridge\IB_Rest\con
fig_files\IBRest.prop has been read
Jul 7, 2011 7:29:26 PM <clinit>
WARNING: Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path This driver is not configured for integrated authentication.
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at IB_Post_DocB.getDBConn(
at IB_Post_DocB.main(
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)
... 12 more
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

I believe, putting the DLL reference in Classpath and Path, should solve your problem.

Not many get the right opportunity !
kevind duff

Joined: Jul 07, 2011
Posts: 23

Thanks for your quick reply.

I am checking the details as carefully as I can.

C:\Windows\system32 is in the path and sqljdbc_auth.dll is in C:\Windows\system32. See below.
And the error specifically says no sqljdbc_auth in java.library.path

Please also note when I run this code in Eclipse sqljdbc_auth.dll is not in the classpath.

I am confused. javascript:emoticon('');


C:\>dir C:\Windows\system32\sqljdbc*.dll
Volume in drive C is OS
Volume Serial Number is 9A4D-215A

Directory of C:\Windows\system32

04/19/2010 10:08 AM 86,408 sqljdbc_auth.dll
1 File(s) 86,408 bytes
0 Dir(s) 196,831,354,880 bytes free


Fail Everyday

Joined: Jul 12, 2011
Posts: 1

i had the same issue while using the Microsoft SQL Server JDBC Driver 3.0
Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path

I am using a custom ant target connecting to a MS SQL DB during execution. I have putted the jar "sqljdbc4.jar" into my class path and got the above exception.
solution for me was adding the mentioned dll to the windows Path variable ( yes ugly but adding it to the classpath in my ant target didn't work)

if your are using the Microsoft SQL Server JDBC Driver 3.0, there is a auth dll for each plattform in your "installation" folder of Microsoft SQL Server JDBC Driver 3.0 -> \sqljdbc_3.0\enu\auth\, in my case x86 ....
kevind duff

Joined: Jul 07, 2011
Posts: 23
Hello All:

I found the solution. The location of sqljdbc_auth.dll must be specified using -Djava.library.path=[path to MS_SQL_AUTH_DLL]

Where [path to MS_SQL_AUTH_DLL] is path to the directory containing the sqljdbc_auth.dll.
Please note another got'ya the sqljdbc_auth.dll must match the JVM you are running.
If you are using 32 bit JVM use the 32 bit DLL, for 64 bit JVM use the 64 bit DLL.

This may help

I agree. Here's the link:
subject: no sqljdbc_auth in java.library.path
It's not a secret anymore!