Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.ConnectException:

 
faisal hameed
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make method to establish connection with
sql server 2000
without DSN.But i am getting exception.I have tried on net but not found solution.
My server is running.
I checked in server network utility.Port no is correct(1433).



The exception is :
SQLException : com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible that TCP/IP is not enabled in your SQL Server,
or that there is something wrong with your computer. Is it plugged into a network?

From the error message, the first option is more likely.

See also:
http://forums.sun.com/thread.jspa?messageID=4385984#4385984

 
faisal hameed
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read this but still there is same exception.
My firewall is also turn off and i tried to telnet this port no(1433).The result is

C:\Documents and Settings\Administrator>netstat

Active Connections

Proto Local Address Foreign Address State
TCP faisal:1129 localhost:1130 ESTABLISHED
TCP faisal:1130 localhost:1129 ESTABLISHED
TCP faisal:1215 localhost:1216 ESTABLISHED
TCP faisal:1216 localhost:1215 ESTABLISHED
TCP faisal:5152 localhost:1374 CLOSE_WAIT
TCP faisal:1137 cs121.msg.ac4.yahoo.com:5050 ESTABLISHED
TCP faisal:1217 sip3.voice.re2.yahoo.com:5050 ESTABLISHED
TCP faisal:2869 192.168.1.1:1032 CLOSE_WAIT

C:\Documents and Settings\Administrator>telnet 127.0.0.1 1433
Connecting To 127.0.0.1...Could not open connection to the host, on port 1433: C
onnect failed
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic