Results 1 to 3 of 3
  1. #1
    saso1310 is offline Member
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    0

    Default Error in establishing socket connection

    look guys:
    i am using sql server 2000
    and this is my code:
    Java Code:
     public static Connection connect()
                {try{
                        if(con==null)
                        {
                              //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                              Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                            //  con=DriverManager.getConnection("192.168.100.33/ISA-2:jdbc:odbc:mobiarab:1433","Test","test");
                              //  con=DriverManager.getConnection("jdbc:microsoft:sqlserver://196.219.106.148/MOBIARAB1:1433;databaseName=MobiDB;selectMethod=cursor;", "MOBI","MOBI");
                               con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=XtreamDB;selectMethod=cursor;", "","");
                               
                        }
              //      state=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
                    
                  }catch(Exception e){e.printStackTrace();System.out.println("Error Trace in getConnection() : " + e.getMessage());
    }     return con;
     }
    and this is the exception:
    Java Code:
    run:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
            at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
            at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
            at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
            at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
            at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
            at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
    Error Trace in getConnection() : [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
            at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
    null
            at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:185)
            at remoteconnection.Main.connect(Main.java:43)
            at remoteconnection.Main.main(Main.java:26)
    BUILD SUCCESSFUL (total time: 3 seconds)
    i also configured the tcp/ip in the enterprise manager to be fixed at port 1433
    and added the 1433 and 1434 ports and sqlserver programs in my firewall as exceptions iam trying to make every possible action to make the sql listen to the tcp/ip and get my connection but in vain
    i am using windows vista and i noticed a very weired thing when i open the SQL Server Network Utility i dont see my local instance while it is there in connection in the enterprise manager
    pleeez guys it's getting crazy if any one have any clue about this i'll be more than thankfull
    thanks in advance

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    804
    Rep Power
    6

    Default

    Hi,
    Could you ping and check whether 192.168.100.33 is active or not?
    Please do check the servername.

    -Regards
    Ramya
    Ramya:cool:

  3. #3
    saso1310 is offline Member
    Join Date
    Aug 2008
    Posts
    4
    Rep Power
    0

    Default pinging by ip adress is ok

    ping 196.219.106.152 -t
    is working smoothle and this is the ip im trying to access and it is the local host by the way
    is there a problem n this line:
    Java Code:
    con=DriverManager.getConnection("jdbc:microsoft:sqlserver://196.219.106.152:1433;databaseName=XtreamDB;selectMethod=cursor;", "","");
    or:
    Java Code:
    con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=XtreamDB;selectMethod=cursor;", "","");

Similar Threads

  1. Replies: 3
    Last Post: 04-13-2010, 03:43 PM
  2. Replies: 4
    Last Post: 02-02-2009, 04:05 PM
  3. Replies: 3
    Last Post: 01-26-2009, 05:30 PM
  4. Replies: 5
    Last Post: 11-08-2008, 06:15 AM
  5. How To Make Socket Connection
    By madhumurundi in forum Networking
    Replies: 5
    Last Post: 04-21-2008, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •