aspose file tools*
The moose likes JDBC and the fly likes How can i fix the following error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How can i fix the following error" Watch "How can i fix the following error" New topic
Author

How can i fix the following error

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
I get the following error:
SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
I have included the driver jar files in the classpath. How can i fix this?
Thank u all for your time
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
i think ur port is not connected ur pc .I mean sqlserver port .Pls check the port number whethere it is working or not using scoket program
import java.io.*;
public class pp {
public static void main(String jj[]) {
try {
java.net.Socket sock1 = new java.net.Socket("vasu",1433);
// here vasu is the pc name
// 1433 is the driver port for sqlserver using datadirect
System.out.println(sock2);
sock1.close();
} catch (Exception ex) {
ex.printStackTrace();}
}
}
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
prior to this one ie sql2000 type 4 driver; I used another type 4 driver and I had no problems. I have seen other people have the same problem with the microsoft driver. Any suggestions?
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
1. re-order the drivers in your classpath.
2. stop using microsoft provided drivers


Multi Platform Database Developer & DBA on E.S.T.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can i fix the following error