This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark " " Watch " " 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 : The TCP/IP connection to the host has failed. Connection refused: connect

Regards, M Faisal Hameed
PUCIT, Pakistan
Jan Cumps

Joined: Dec 20, 2006
Posts: 2562

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: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 agree. Here's the link:
It's not a secret anymore!