This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

jtds error while connecting to MS SQL server 2008  RSS feed

 
Ranch Hand
Posts: 44
  • 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
 
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: 44
  • 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!
 
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: 44
  • 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
Boost this thread!