• 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
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Just installed MS SQL Server 5 Express. JDBC connection failing

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed MS SQL Server 5 Express. Downloaded sqljdbc.jar and added it to classpath. Trying to connect to a table with 5 rows as a test.
When I run the program it is generating the following error: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect". I, then, tried by replacing localhost with IP address 111.11.11.11. Got the same error message. Any idea what mistake I'm making?
 
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
By default, SQL Server does not allow remote connections over TCP/IP. Check you have enabled this via the network configuration tool.
[ November 05, 2008: Message edited by: Paul Sturrock ]
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Between my first post on this matter and now I checked some internet resources and enabled the TCP/IP using configuration manager. I restarted SQL server and re-ran the program. Still getting the same error
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Friends! I got it. Port in the SQL Server is different. I corrected port number in my code and connection succeeded. Thanks
 
Paul Sturrock
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
Glad to hear it
reply
    Bookmark Topic Watch Topic
  • New Topic