com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

Published Mar 23 2019 05:03 AM 16.1K Views
Microsoft
First published on MSDN on Jun 18, 2007

On a Windows platform, when trying to connect to SQL Server using Integrated Authentication, you may see this exception:
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.
along with the following trace message:
com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll


This generally indicates that the driver can not find the appropriate sqljdbc_auth.dll in the JVM library path.  To correct the problem, please use the java.exe -D option to specify the "java.library.path" system property value.  You will want to specify the full path to the directory contain the sqljdbc_auth.dll.
For example:  java -cp .;"c:\jdbcv1_2\sqljdbc.jar" -Djava.library.path="c:\jdbcv1_2\auth\x86" myApp


Alternatively, you can copy the sqljdbc_auth.dll to a directory in the search path (example: the local directory where you are executing your application).


Note: You may also get the same error message if the application is trying to use the incorrect architecture (x86 VS x64) version of the sqljdbc_auth.dll.  Try specifying the directory path to the other architecture.
If you are on a x64 machine running x64 OS, but the JVM you are using is the x86 version, you will need to specify and use the x86 version of the sqljdbc_auth.dll.


Some related information:
If you get the following exception:
java.lang.UnsatisfiedLinkError: GetDNSName
This typically indicates that the application is trying to use the incorrect version (say v1.0 VS v1.1) of the sqljdbc_auth.dll.  Make sure the application is using the save version of the sqljdbc.jar and sqljdbc_auth.dll files.


Jimmy Wu, SQL Server
Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights

%3CLINGO-SUB%20id%3D%22lingo-sub-383296%22%20slang%3D%22en-US%22%3Ecom.microsoft.sqlserver.jdbc.SQLServerException%3A%20This%20driver%20is%20not%20configured%20for%20integrated%20authentication.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-383296%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Jun%2018%2C%202007%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EOn%20a%20Windows%20platform%2C%20when%20trying%20to%20connect%20to%20SQL%20Server%20using%20Integrated%20Authentication%2C%20you%20may%20see%20this%20exception%3A%20%3CBR%20%2F%3E%20com.microsoft.sqlserver.jdbc.SQLServerException%3A%20This%20driver%20is%20not%20configured%20for%20integrated%20authentication.%20%3CBR%20%2F%3E%20along%20with%26nbsp%3Bthe%20following%26nbsp%3Btrace%20message%3A%20%3CBR%20%2F%3E%20com.microsoft.sqlserver.jdbc.AuthenticationJNI%20%3CCLINIT%3E%20%3CBR%20%2F%3E%20WARNING%3A%20Failed%20to%20load%20the%20sqljdbc_auth.dll%3C%2FCLINIT%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThis%20generally%20indicates%20that%20the%20driver%20can%20not%20find%20the%20appropriate%26nbsp%3Bsqljdbc_auth.dll%26nbsp%3Bin%20the%20JVM%20library%20path.%26nbsp%3B%20To%20correct%20the%20problem%2C%20please%20use%20the%20java.exe%20-D%20option%20to%20specify%20the%20%22java.library.path%22%20system%20property%20value.%26nbsp%3B%20You%20will%20want%20to%20specify%20the%20full%20path%20to%20the%20directory%20contain%20the%20sqljdbc_auth.dll.%20%3CBR%20%2F%3E%20For%20example%3A%26nbsp%3B%26nbsp%3Bjava%20-cp%20.%3B%22c%3A%5Cjdbcv1_2%5Csqljdbc.jar%22%20-Djava.library.path%3D%22c%3A%5Cjdbcv1_2%5Cauth%5Cx86%22%26nbsp%3BmyApp%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EAlternatively%2C%20you%20can%20copy%20the%20sqljdbc_auth.dll%20to%20a%20directory%20in%20the%20search%20path%20(example%3A%20the%20local%20directory%20where%20you%20are%20executing%20your%20application).%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ENote%3A%20You%26nbsp%3Bmay%20also%26nbsp%3Bget%20the%20same%26nbsp%3Berror%20message%20if%20the%20application%20is%20trying%20to%20use%20the%20incorrect%20architecture%20(x86%20VS%20x64)%20version%20of%20the%20sqljdbc_auth.dll.%26nbsp%3B%20Try%20specifying%20the%20directory%20path%20to%20the%20other%20architecture.%20%3CBR%20%2F%3E%20If%20you%20are%20on%26nbsp%3Ba%20x64%20machine%20running%20x64%20OS%2C%20but%20the%20JVM%20you%20are%20using%20is%20the%20x86%20version%2C%20you%20will%20need%20to%20specify%20and%20use%20the%20x86%20version%20of%20the%20sqljdbc_auth.dll.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3ESome%20related%20information%3A%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20If%20you%20get%20the%20following%20exception%3A%20%3CBR%20%2F%3E%20java.lang.UnsatisfiedLinkError%3A%20GetDNSName%20%3CBR%20%2F%3E%20This%20typically%20indicates%20that%26nbsp%3Bthe%20application%26nbsp%3Bis%20trying%20to%20use%20the%20incorrect%20version%20(say%20v1.0%26nbsp%3BVS%20v1.1)%26nbsp%3Bof%20the%20sqljdbc_auth.dll.%26nbsp%3B%20Make%20sure%20the%20application%20is%20using%20the%20save%20version%20of%20the%20sqljdbc.jar%20and%20sqljdbc_auth.dll%20files.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EJimmy%20Wu%2C%20SQL%20Server%20%3CBR%20%2F%3E%20Disclaimer%3A%20This%20posting%20is%20provided%20%22AS%20IS%22%20with%20no%20warranties%2C%20and%20confers%20no%20rights%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-383296%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Jun%2018%2C%202007%20On%20a%20Windows%20platform%2C%20when%20trying%20to%20connect%20to%20SQL%20Server%20using%20Integrated%20Authentication%2C%20you%20may%20see%20this%20exception%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%20com.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-383296%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerDrivers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Mar 23 2019 05:03 AM
Updated by: