aspose file tools*
The moose likes JDBC and the fly likes Why cant connect to another computer in lan? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Why cant connect to another computer in lan?" Watch "Why cant connect to another computer in lan?" New topic
Author

Why cant connect to another computer in lan?

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
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
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Oh, after I tried another computer, I found that the 192.168.0.157 machine is the trouble. But I still not know why.
Martin Simons
Ranch Hand

Joined: Mar 02, 2006
Posts: 196
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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why cant connect to another computer in lan?