wood burning stoves 2.0
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "java.net.ConnectException: " Watch "java.net.ConnectException: " New topic


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

Joined: Dec 20, 2006
Posts: 2543

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:

OCUP UML fundamental and ITIL foundation
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 CLOSE_WAIT

C:\Documents and Settings\Administrator>telnet 1433
Connecting To not open connection to the host, on port 1433: C
onnect failed
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: java.net.ConnectException:
It's not a secret anymore!