Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > Connection Errors
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 24th January 06:54
brian andersen
External User
 
Posts: 1
Default Connection Errors



I am trying to connect to SQL Server 2000 using MS JDBC
Drivers and am getting the following error:

....Error establishing socket.

I have verified the following:

-I can ping the server.
-The port number has been verified using "Server Network
Utility". (The port is 1433)
-TCPIP is enabled.
-There is only one instance of SQL Server.

The strange thing is that I can setup an ODBC source that
will connect to the database. However, if when setting up
the ODBC source I manually change the port number (using
the "Client Configuration" button) it won't connect.

Is there anyway the Port number in the "Server Network
Utility" could be wrong?

Does anyone have any ideas on this?
  Reply With Quote


  sponsored links


2 24th January 06:54
joe weinstein
External User
 
Posts: 1
Default Connection Errors



Sure. Run this code with the machine name and 1433:

import java.io.*;
import java.net.*;

public class isAnythingListeningOn
{
public static void main(String argv[])
throws Exception
{
if (argv.length != 2) {
System.out.println("Usage: isAnythingListeningOn <host> <port>");
System.out.println("eg:\n% java isAnythingListeningOn myMachine
1433");
System.exit(0);
}

try
{
System.out.println("\nTrying to open a socket with host "
+ argv[0] + " and port " + argv[1] + " ...");
Socket socket = new Socket(argv[0],(new
Integer(argv[1]).intValue()));
System.out.println("\nYes, there is, we got a socket.");
socket.close();
}
catch (Exception e)
{
System.out.println("We failed to open a socket. Here's why:\n");
e.printStackTrace();
System.out.println("\n(Either there is no machine named '" + argv[0]
+ "' or\nnothing is listening there on port "
+ argv[1] +")\n");
}
}
}
  Reply With Quote
3 24th January 06:54
joe weinstein
External User
 
Posts: 1
Default Connection Errors


There is no other option. MS SQLServer doesn't have a separate
process listening for connection requests. It's just the DBMS
process itself. An MS wonk may be able to say whether the DBMS
is supposed to start listening for TCP connections as soon as
you tell it to, or whether it needs to be restarted for that to take effect. Joe
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666