• 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:

jtds error while connecting to MS SQL server 2008

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

I am trying to connect to MS SQL 2008 server using jtds.

Class.forName("net.sourceforge.jtds.jdbc.Driver");

Connection con = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1433/tempdb","sa","");

MSSQL server is running.

But i am getting

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

I am stuck with this error for one whole day . I want to do some Hibernate and JDBC conection trials too.

Can anyone suggest the root cause?

Note: CLASSPATH variable is set with jtds.jar
 
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
Is SQL Server configured to accept connections over TCP/IP? Why are you trying to connect to the tempdb? If your username and password correct?
 
prathamesh bandivadekar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont have any idea about that!

Can you please tell me how to check whether my MS SQL server is configured for that or not?

I think it is easy to work with Oracle rather than working with MS,they alwayz make things complicated!

Oralce do not have such config for TCP/IP!
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked jtds faq?
 
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
Use SQL Server Configuration Manager to check. By default, SQL server is not configured to allow connections over TCP/IP.



I think it is easy to work with Oracle rather than working with MS,they alwayz make things complicated!


never heard anyone call Oracle easier to configure than SQL Server before.
 
prathamesh bandivadekar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is resolved.

I have uninstalled MS SQL server from my machine!

I dont want that programe running on my machine!

Making things complicated and dependant is the legacy of MS!

Using MySQL now!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic