File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vighnesh Mu
Greenhorn
Posts: 29
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Screenshot.jpg
[Thumbnail for Screenshot.jpg]
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vighnesh Mu
Greenhorn
Posts: 29
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20161
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic