Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

chethan hs

Greenhorn
+ Follow
since Jan 12, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by chethan hs

I am unable to connect to sql server, getting following error.

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.".

**my local Environment:-**

java 5,
sql server enterprise manager version 8,
OS- window server 2003



**RunApp.java**

   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'");

**running through cmd:**

   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\sqljdbc.jar;" com\test\RunApp.java
   
   java -classpath "D:\Web Development\ABC\lib\mail-1.4.3.jar;D:\Web Development\ABC\lib\sqljdbc.jar;" com.test.RunApp