• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

trying to connect sql server 2000 - not connected

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I am trying to connect sql server.

i have installed the driver(jtds)

but unable to connect

unable to connection2
java.sql.SQLException: Network error IOException: Connection refused: connect

please help.
 
Bartender
Posts: 612
7
Mac OS X Python
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a start i would suggest.

Post your code (use code tags)

Post the exact and total error message
 
Sheriff
Posts: 22853
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The machine is refusing the connection. Make sure that you are connecting to the right machine, it has the SQL Server running, no firewall is blocking access and SQL Server allows remote connections.
 
Anand Sivathanu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I have ms sql server 2000 running in my machine port -1433(default)
username=sa
password=admin

this is the error(compile time)

java.sql.SQLException: Network error IOException: Connection refused: connect
 
Marshal
Posts: 80767
488
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This thread would sit better on our databases forum. Moving.
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have any Anti-virus software installed on you machine with firewall enabled ?, Because it may be block the request.
If you have, then disable its all operation and then check it...
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


this is the error(compile time)

java.sql.SQLException: Network error IOException: Connection refused: connect


Compile time? Do you mean runtime?

I'm a little surprised you are getting as far as this SQLException, you are using jTDS but your JDBC URL is for Microsoft's own driver. Which are you using?

Connections are refused by SQL Server 2000 for the following reasons:

  • Using the wrong usernane or password
  • The server instance is not configured to accept TCP/IP connections (in SQL Server 2000 it is by default I think, later versions this is not true)
  • The server instance is configured to only use Windows Integrated authentication (which is t he default for SQL server)
  • The server OS doesn't have any service packs applied (out the box with no SPs SQL Server 2000 just doesn't seem to work).
  • reply
      Bookmark Topic Watch Topic
    • New Topic