title: Windows authentication with SQL Server using Java
body: <p>Follow up to this question:
  <a href="https://stackoverflow.com/a/12304934/866785">https://stackoverflow.com/a/12304934/866785</a></p>
  
  <p>I am also trying to connect to <strong>SQL Server 2008 R2</strong> with <strong>Windows Authentication</strong> using <strong>Java</strong>.</p>
  
  <p>I have set the <strong>PATH variable</strong> to include </p>
  
  <p><code>C:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\auth\x64</code> </p>
  
  <p>But I still get the error:</p>
  
  <p><code>java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path</code></p>
  
  <p>I am using <strong>Netbeans IDE</strong>, and also tried setting <strong>-Djava.library.path</strong>="C:\Program Files\Microsoft JDBC Driver 4.0  for SQL Server\sqljdbc_4.0\enu\auth\x64" as described in <a href="https://stackoverflow.com/questions/12798530/including-native-library-in-netbeans">this question</a>  but to no avail. </p>