Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jtds error while connecting to MS SQL server 2008

 
prathamesh bandivadekar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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: 43
  • Mark post as helpful
  • send pies
  • 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!
 
Shantanu Puranik
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked jtds faq?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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: 43
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic