oracle jdbc driver version madness

若如初见. 提交于 2019-11-28 20:38:43
Oliver Michels

please see the compatibility matrix at http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#02_02

Also take in mind that the timestamp datatype is only available since Oracle 10.

The numbers in ojdbc14.jar, ojdbc5.jar, ojdbc6.jar, ojdbc7.jar and ojdbc8.jar refer to the version of the Java compiler that was used. With every version of Java come new JDBC APIs so these numbers are useful to know what to expect. For example in Java 8, there is a new method executeLargeUpdate in java.sql.PreparedStatement. This method will be implemented in ojdbc8.jar but not in ojdbc7.jar. Also if your runtime uses Java 7 then you know you can't use ojdbc8.jar otherwise you'll run into a java.lang.UnsupportedClassVersionError error. These are the reasons why Oracle includes these numbers in the jar's name. Also note that if you want to know from which Oracle Database release the jar comes from you can run java -jar ojdbc8.jar. Both the Database and the driver are backward compatible (up to 1 major release) so, even though it's recommended, you don't have to use the same version of the product on both tiers.

When we upgraded our Oracle database from 8.1.7 to 10.2.0, I was able to use the same Oracle jdbc driver (ojdbc14.jar). So their jdbc driver supports quite a few versions at the same time. Of course it's possible that some of the drivers are buggy, but the plan is to support more versions at the same time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!