Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-18-2009, 01:00 PM
Member
 
Join Date: Aug 2008
Posts: 4
Rep Power: 0
saso1310 is on a distinguished road
Default Error in establishing socket connection
look guys:
i am using sql server 2000
and this is my code:
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:
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
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 05-18-2009, 01:18 PM
RamyaSivakanth's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Chennai
Posts: 533
Rep Power: 1
RamyaSivakanth is on a distinguished road
Default
Hi,
Could you ping and check whether 192.168.100.33 is active or not?
Please do check the servername.

-Regards
Ramya
__________________
Ramya
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-18-2009, 02:00 PM
Member
 
Join Date: Aug 2008
Posts: 4
Rep Power: 0
saso1310 is on a distinguished road
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:
Code:
con=DriverManager.getConnection("jdbc:microsoft:sqlserver://196.219.106.152:1433;databaseName=XtreamDB;selectMethod=cursor;", "","");
or:
Code:
con=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=XtreamDB;selectMethod=cursor;", "","");
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make server Wait for clients further requests after establishing connection nadia Networking 4 02-02-2009 05:05 PM
Error opening socket: java.net.ConnectException: Connection refused: connect somersst Java Servlet 3 01-26-2009 06:30 PM
Hibernator with eclipse : Problem in establishing the connection abhibh_1 Eclipse 5 11-08-2008 07:15 AM
Software caused connection abort: socket write error kuguy Networking 2 05-21-2008 07:29 AM
How To Make Socket Connection madhumurundi Networking 5 04-21-2008 07:05 PM


All times are GMT +2. The time now is 03:41 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org