• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

trying to connect sql server 2000 - not connected

 
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.
 
Bartender
Posts: 612
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
 
Sheriff
Posts: 21788
104
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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
 
Marshal
Posts: 65457
248
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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).
  •  
    I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
    create, convert, edit or print DOC and DOCX in Java
    https://products.aspose.com/words/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!