• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to connect sql server 2000 - not connected

 
Anand Sivathanu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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.
 
Steve Fahlbusch
Bartender
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a start i would suggest.

Post your code (use code tags)

Post the exact and total error message
 
Rob Spoor
Sheriff
Pie
Posts: 20753
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Campbell Ritchie
Sheriff
Posts: 51468
87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread would sit better on our databases forum. Moving.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • 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...
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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).
  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic