This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, In my Connect class, I can successfully connect to database in localhost, but failed to connect to another computer in the same lan. What's more my sql server 2000 enterprise manager can link to that computer's database server. My Connect class is as following. When this run, exceptions is as following.
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establis hing 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 Sou rce) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown S ource) at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at Connect.getConnection(Connect.java:27) at Connect.main(Connect.java:55) Error Trace in getConnection() : [Microsoft][SQLServer 2000 Driver for JDBC]Erro r establishing socket.
Can any of you give me some advices?Thank you.
SCJP 1.4 SCJD
Joined: Jan 25, 2006
Oh, after I tried another computer, I found that the 192.168.0.157 machine is the trouble. But I still not know why.
the db is not "listening", at least at that ip/port combination, is the only thing I can assume. Also, I hope that is not real connection information you provided in your post (i.e. user and password).