title: I/O Error: SSO Failed: Native SSPI library not loaded
body: <p>I am trying to run the following bit of code:</p>
  
  <pre><code>import java.sql.DriverManager;
  
  public class Connect {
      public static void main(String[] args){
          try{
              String databaseDriver = "net.sourceforge.jtds.jdbc.Driver";
              Class.forName(databaseDriver);
          }
          catch (Exception e) {
              e.printStackTrace();
          }
  
          try{
              String url = "jdbc:jtds:sqlserver://BHX:1433/Forecast;instance=SQLEPXRESS";
              java.sql.Connection con = DriverManager.getConnection(url);
              System.out.println("Connection");
          }
          catch (Exception e){
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>My SQL server is running on port 1433 on machine BHX.</p>
  
  <p>The error message I'm getting is as follows:</p>
  
  <pre><code>java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. Check the     java.library.path system property.
      at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:615)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC2.&lt;init&gt;(ConnectionJDBC2.java:352)
      at net.sourceforge.jtds.jdbc.ConnectionJDBC3.&lt;init&gt;(ConnectionJDBC3.java:50)
      at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:185)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at Connect.main(Connect.java:14)
  Caused by: java.io.IOException: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.
      at net.sourceforge.jtds.jdbc.TdsCore.sendMSLoginPkt(TdsCore.java:1893)
      at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:588)
      ... 6 more
  </code></pre>
  
  <p>I've read up on why this usually occurs and found a similar question <a href="https://stackoverflow.com/questions/4219968/java-sql-sqlexception-i-o-error-sso-failed-native-sspi-library">here</a>, but this doesn't seem to work. When running the code I've inlcuded the following argument to locate the SSO file:</p>
  
  <pre><code>-Djava.library.path=/Tester/jdbc/x64/SSO
  </code></pre>
  
  <p>And this is the structure of my files</p>
  
  <pre><code>**Tester**
     *src*
       default package
           Connect.java
     *JRE System Library*
     *jdbc*
       conf
       html
       IA64
       x64
         SSO
          ntlmauth.dll
       x86
  </code></pre>
  
  <p>Can you spot anything wrong?</p>