aspose file tools*
The moose likes JDBC and the fly likes java.net.ConnectException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.net.ConnectException: " Watch "java.net.ConnectException: " New topic
Author

java.net.ConnectException:

faisal hameed
Ranch Hand

Joined: Jan 19, 2009
Posts: 48
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

Regards, M Faisal Hameed
PUCIT, Pakistan
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

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


OCUP UML fundamental and ITIL foundation
youtube channel
faisal hameed
Ranch Hand

Joined: Jan 19, 2009
Posts: 48
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.net.ConnectException: