title: The TCP/IP connection to the host, port 1433 has failed
body: <p>I am new to JDBC connections and I am very confused. I have enable TCP/IP and Named Pipes and in TCP/IP -> IP Adresses I have set TCP port to 1433 and I have restarted the server. I have also open access to SQL Server via Windows Firewall with Advanced Security. The problem is that I still get this error:</p>
  
  <blockquote>
    <p>SQLException: The TCP/IP connection to the host MSSQL$SQLFULL, port
    1433 has failed. Error: "null. Verify the connection properties, check
    that an instance of SQL Server is running on the host and accepting
    TCP/IP connections at the port, and that no firewall is blocking TCP
    connections to the port."</p>
  </blockquote>
  
  <p>I run on cmd the following: <code>telnet SQLFULL 1433</code> and I get this message:
  Could not open connection to the host on port 1433 : connect failed</p>
  
  <p>My code: </p>
  
  <pre><code>String url = "jdbc:sqlserver://MSSQL$SQLFULL:1433;databaseName=BA_ELTRUN;";
  Connection dbcon = null;
  String errorMessages = "";
  
  try
  {
      Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
  }
  catch(java.lang.ClassNotFoundException e)
  {
      System.out.print("ClassNotFoundException: ");
      System.out.println(e.getMessage());
  }
  
  try
  {
      dbcon = DriverManager.getConnection(url,"username","password");
  }
  catch(SQLException e)
  {
       System.out.print("SQLException: ");
       System.out.println(e.getMessage());
       errorMessages = "Could not close connection with the Database Server: &lt;br&gt;"
                      + e.getMessage();
                      throw new SQLException(errorMessages);
  }
  </code></pre>
  
  <p>Can anyone help?</p>