File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes How to resolve Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to resolve"java.sql.SQLException: Network error IOException: Connection refused: connect"" Watch "How to resolve"java.sql.SQLException: Network error IOException: Connection refused: connect"" New topic
Author

How to resolve"java.sql.SQLException: Network error IOException: Connection refused: connect"

Vighnesh Mu
Greenhorn

Joined: Jan 06, 2011
Posts: 29

I installed a "SQLSERVER 2000" on my system and I tried to access the same in java using jtds driver with the following connection details -


But when I try running the program getting the following error -



Please help me resolving this issue as I tried a lot on this from past 2 days without any success.

Please refer the screenshot for SQL server installation in my system,which I installed on D: drive.

Thanks in advance.


[Thumbnail for Screenshot.jpg]

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

Vighnesh Udup wrote:I installed a "SQLSERVER 2000" on my system

Are you aware that SQL Server 2000 is really outdated? It's been superseded by both SQL Server 2005 and SQL Server 2008 already.

That said, your connections are being denied. There are three possible reasons:
1) you have some firewall software that is blocking the connection.
2) the SQL Server 2000 is running on a different port.
3) your SQL Server 2000 is not configured to accept non-local connections.

To check if this is set correctly, open the "Server Network Utility". Make sure that TCP/IP is one of the enabled protocols, select it on the right and click Properties. Make sure that the port is 1433, or change the port in the connection string to match this port.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Vighnesh Mu
Greenhorn

Joined: Jan 06, 2011
Posts: 29

Are you aware that SQL Server 2000 is really outdated? It's been superseded by both SQL Server 2005 and SQL Server 2008 already.

I am aware it's outdated and tried new versions too,but got the same problem so using the older one only as it's little smaller in size and simpler.
1) you have some firewall software that is blocking the connection.

I disabled both windows firewall and antivirus then tried, but still the problem persist.
2) the SQL Server 2000 is running on a different port.

I checked in "server network utility" and the prot is set to 1433 and it's enabled, but the same error again.
3) your SQL Server 2000 is not configured to accept non-local connections.

I didn't get this point. Can you please tell me is this might be the reason as I installed SQL on my local system and in that system only I am trying to access programatically. But when I access SQL through SQL console it opens with the above given username and password. Is there any problem in the path or username and password I am using?

Thank you.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18643
    
    8

Do you actually have the server running? On the same computer as where you are running that code? Try running netstat to see if there is any program listening at port 1433 there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to resolve"java.sql.SQLException: Network error IOException: Connection refused: connect"