Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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

 
Greenhorn
Posts: 29
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Sheriff
Posts: 22511
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 26914
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic