File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot Connect To MS-SqlServer 2008 R2

 
Khalil Salman
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I just started with Java,
I'm using Netbeans 6.9.1 as IDE, MS-SqlServer 2008 R2 as database server, and Struts 1.3.1 as framework...
The problem is that I just keep getting this error:

java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.

I downloaded the jdbc 3.0 from microsoft's web page. And I only added sqljdbc4.jar to my project. But strangely error message says that the driver you use is not supported by JDBC 4.0, so use sqljdbc4.jar.

Any idea?..
Any help would be really appreciated...
 
Khalil Salman
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry guys but I've been fighting with this problem for last 3 days. No success.
But I just solved the problem.

In the beginning I had added jdbcsql4.jar as a jar file only..
But now I added a library to the project and I named that library as 'ms-jdbc'
Then I added jdbcsql4.jar to that new library which named ms-jdbc by me.

Strangely it worked out.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to be sorry about: well done sorting it out, and thank you for explaining it in case anybody else has a similar problem.

And welcome to JavaRanch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic