7 Replies Latest reply on Apr 16, 2008 7:26 PM by 843859

    [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket

    843859
      import java.sql.*; import com.microsoft.sqlserver.jdbc.*; public class DBConnection { Connection con;     Statement stmt;         //method to connect to the database     public Statement connect ()     {         try         {                                          DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); String dbURL = "jdbc:sqlserver://localhost:1433;databaseName=System Databases\\master";                         try             {                 //Establish a Connection                 con = DriverManager.getConnection(dbURL);                 //This will enable us to query the database                 stmt=con.createStatement();                            }             catch (SQLException ex)             {                 System.out.println("An exception has occured: "+ex);             }         }         catch(Exception e)         {             System.out.println("An exception has occured: "+e);         }         return stmt;     }     }

      here is the code and i'm getting the following exception :
      An exception has occured: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.

      any help??