Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Why cant connect to another computer in lan?

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, after I tried another computer, I found that the 192.168.0.157 machine is the trouble. But I still not know why.
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
    Bookmark Topic Watch Topic
  • New Topic