title: Connecting to SQL Server results in error "The driver received an unexpected pre-login response"
body: <p>I am unable to connect to sql server, getting following error.</p>
  
  <p>exception com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection
  to the host SSALES, port 1433 has failed. Error: "The driver received an unexpe
  cted pre-login response. Verify the connection properties and check that an inst
  ance of SQL Server is running on the host and accepting TCP/IP connections at th
  e port. This driver can be used only with SQL Server 2000 or later.".</p>
  
  <p><strong>my local Environment:-</strong></p>
  
  <p>java 5,
  sql server enterprise manager version 8,</p>
  
  <p><strong>RunApp.java</strong></p>
  
  <pre><code>Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); 
  conn = java.sql.DriverManager.getConnection("jdbc:sqlserver://abc;d‌​atabaseName={db};use‌​r=name;password=pass‌​worf;");
  Statement stmt=conn.createStatement();  
  ResultSet rs=stmt.executeQuery("SELECT * FROM testdb.testtabel where active = 'a'");
  </code></pre>
  
  <p><strong>running through cmd:</strong></p>
  
  <pre><code>set path="C:\Program Files\Java\jdk5\bin";
  
  javac -classpath "D:\Web Development\ABC\lib\mail-1.4.3.jar;D:\Web Development\ABC\lib\json-simple.jar;D:\Web Development\ABC\lib\sqljdbc.jar;" com\test\RunApp.java
  
  java -classpath "D:\Web Development\ABC\lib\mail-1.4.3.jar;D:\Web Development\ABC\lib\json-simple.jar;D:\Web Development\ABC\lib\sqljdbc.jar;" com.test.RunApp  
  </code></pre>