Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqljdbc : JDBC driver sqljdbc.jar Vs sqljdbc4.jar

Tags:

sqljdbc

I have a query regarding the jars sqljdbc.jar and sqljdbc4.jar which are used to connect to MS SQL Server 2005 for the systems where the JDK version 1.5 & 1.6 respectively. Now I would like to know, how these jars interpret the column whose datatype is 'XML' in one of the DB table in MS SQL Server 2005, when trying to access from both the systems where the JDK versions are 1.5 & 1.6 using sqljdbc.jar & sqljdbc4.jar respectively?

Is there any difference in interpreting the XML data type using sqljdbc.jar and sqljdbc4.jar?

Thank you very much in advance,

Regards, Laaksha

like image 461
user968804 Avatar asked Sep 28 '11 10:09

user968804


2 Answers

From http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/8c1721c1-781f-4ad0-b656-a2494f3c3978: "These two class libraries are used to support different scenarios. The sqljdbc.jar class library provides support for JDBC 3.0 and the sqljdbc4.jar class library provides support for JDBC 4.0."

like image 55
Jim Bethancourt Avatar answered Oct 13 '22 23:10

Jim Bethancourt


If you are using Java7+, you will need to use sqljdbc4.jar. Using the sqljdbc.jar will result in:

Caused by: java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.7 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
like image 38
Jim Cox Avatar answered Oct 13 '22 23:10

Jim Cox