title: Java7 sqljdbc4 - SQL error 08S01 on getConnection()
body: <p>I'm trying to write a really simple GUI app for inserting some records
  into a database, and reading back some records (nothing fancy, just 1 table with 3 rows, no relations).
  The source...</p>
  
  <pre><code>package EntryProg;
  import java.sql.*;
  import com.microsoft.sqlserver.jdbc.*;
  
  
  
  public class CourseDataEntryHandler
  {
      private Connection connect;
      private CallableStatement callState;
      private ResultSet rSet;
      private SQLServerDataSource dSource;
  
      public CourseDataEntryHandler()
      {
          rSet = null;
          callState = null;
  
          dSource = new SQLServerDataSource();
          dSource.setUser(REDACTED);
          dSource.setPassword(REDACTED);
          dSource.setServerName(REDACTED);
          dSource.setPortNumber(REDACTED);
          dSource.setDatabaseName(REDACTED);
          dSource.setEncrypt(true);
          dSource.setTrustServerCertificate(true);
          try
          {
  </code></pre>
  
  <p>Error here</p>
  
  <pre><code>            connect = dSource.getConnection();
  </code></pre>
  
  <p>end error</p>
  
  <pre><code>        }
          catch (SQLServerException e)
          {
              //TODO Figure out how to handle -- logging for now, console
              do
              {
                  System.out.println(e.getErrorCode());
                  System.out.println(e.getMessage());
                  System.out.println(e.getSQLState());
                  e = (SQLServerException) e.getNextException();
              } while (e != null);
              System.out.println("END");
              System.out.println();
          }
      }
  </code></pre>
  
  <p>I get the following error...</p>
  
  <p>(code)0</p>
  
  <p>(message)SQL Server did not return a response. The connection has been closed.</p>
  
  <p>(state)08S01</p>
  
  <p>I've verified that the user,pass,server name,port, and DB name are all accurate.
  If I change the username to a non-valid one, I get a "could not log in" error reported back so I know I'm hitting the server.</p>
  
  <p>I've not been able to fully connect once, so I know it's not a "too many connections" issue, as the only person currently logged into the server is me via sql management studio. It doesn't work when I log out of that either so definitely not a connections # issue.</p>
  
  <p>The applications user has datareader/datawriter permissions as well.
  (I'm using Eclipse, if that matters. And am referencing the sqljdbc4.jar library).</p>
  
  <p>I'm at a loss as to where to go with troubleshooting this. Any help would be greatly appreciated.</p>
  
  <p><em>EDIT</em>
  Update - I've also tried a connection string and using DriverManager.getConnection(connString) to set the connection, that didn't work either. The result is the same.
  Also, SQL server 2008 r2 is the sql server version I'm using.</p>
  
  <p><em>EDIT</em>
  I wrote a quick C# program to test the connection, sure enough the connection works fine in .net, unfortunately I have to use java for this project (it's a project I've chosen to do on my own for a class, only requirement is it be in Java...teacher has no clue what's going on either).</p>