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