This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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!
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!