title: java.lang.UnsatisfiedLinkError: Native Library sqljdbc_auth.dll already loaded in another classloader
body: <p>I have multiple applications that needs to connect to MSSQL using windows authentication. </p>
  
  <p>The First webApp which is loaded works fine. but the remaining fail prompting</p>
  
  <pre><code>Caused by: java.lang.UnsatisfiedLinkError: Native Library $tomcat/bin/sqljdbc_auth.dll already loaded in another classloader
  </code></pre>
  
  <p>Below is the code used</p>
  
  <pre><code>Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  connection= DriverManager.getConnection("jdbc:sqlserver://localhost;databaseName=XXX;integratedSecurity=true");
  </code></pre>
  
  <p><strong>I Have placed 
          sqljdbc*.jar --> tomcat*/lib  and sqljdbc_auth.dll --> tomcat*/bin</strong></p>
  
  <p>Seems like all my applications are trying to load the shared lib($tomcat/bin/dll) multiple times. Hence the first load works and the remaining fail. </p>
  
  <p><strong>Edit: I understand that the native library (DLL) can only be loaded into the JVM once, hence the error, but I after looking around the net I still have no solution.</strong> </p>
  
  <p>How can i load the dll only once?</p>
  
  <p>Please Help!!</p>