• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC version not supported error

 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i installed JDBC sql server driver 4.0 and configured it for netbeans 6.9 and i got an error saying this version is not supported for jdk 1.6. I went for jdbc 3.0 and i got the same error which is


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 just used the sqljdbc4.jar file in the libraries folder and still got the same error.

Help!
 
Wendy Gibbons
Bartender
Posts: 1107
Eclipse IDE Oracle VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you get the jar from, as it sounds to me like it is a very old jar that was written for a jdk version 1.5 or below.
 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried jdbc for sql server version 4.0

I havent found a method that works for this.
 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed it but i get a new error

SQLException caught: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".

I am using sql server 2008 under windows authentication and my connection string is :

jdbc:sqlserver://localhost:1433;databaseName=sampledb;integratedSecurity=true

 
achuthan mukundarajan
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed the port thing Now i have a NullpointerException while insertion:

The code is given below:
 
Paul Clapham
Sheriff
Pie
Posts: 20168
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then your first step is to find out what line of code threw the exception. Check the stack trace, it tells you exactly that.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic