aspose file tools
The moose likes JDBC and Relational Databases and the fly likes JDBC version not supported error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC version not supported error" Watch "JDBC version not supported error" New topic
Author

JDBC version not supported error

achuthan mukundarajan
Ranch Hand

Joined: May 30, 2012
Posts: 87
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

Joined: Oct 21, 2008
Posts: 1107

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

Joined: May 30, 2012
Posts: 87
I have tried jdbc for sql server version 4.0

I havent found a method that works for this.
achuthan mukundarajan
Ranch Hand

Joined: May 30, 2012
Posts: 87
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

Joined: May 30, 2012
Posts: 87
Fixed the port thing Now i have a NullpointerException while insertion:

The code is given below:
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19468
    
  10

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.
 
subject: JDBC version not supported error