I have 2 java web apps that need to connect to SQL Server Database using Windows Integrated Authentication.
The first one that is loaded works fine but the second one throws the exception:
Native Library sqljdbc_auth.dll already loaded in another classloader
The error above occurs when I place the sqljdbc_auth.dll in one of the folders:
- C:\WINDOWS\system32\
- C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin\
If I place the sqljdbc_auth.dll in one of the folders below:
- /WEB-INF/lib directory of each web application
- C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\
Both apps throw the exception:
Failed to load the sqljdbc_auth.dll cause :- no sqljdbc_auth in java.library.path
I am using this code to load the driver:
Class.forName("jdbc:sqlserver://<HOST>;databaseName=<DBNAME>;integratedSecurity=true;");
How can I solve it?