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