程序员A使用JDBC 3(db2jcc.jar)编写了一个应用程序,并将其部署在WebSphere App Server上.
可以将JDBC连接更改为使用JDBC 4(db2jcc4.jar)而不是JDBC 3吗?
JDBC 4是否与JDBC 3完全兼容?
解决方法:
JDBC 4应该与JDBC 3向后兼容,并且替换驱动程序没有问题.
引用JDBC 4.0 specification 2.2目标概述部分,JDBC 4.0的目标之一是
8) Maintain backward compatibility with existing applications and drivers Existing JDBC technology-enabled drivers ( JDBC drivers) and
the applications that use them must continue to work in an
implementation of the Java virtual machine that supports the JDBC 4.0
API. Applications that use only features defined in earlier releases
of the JDBC API will not require changes to continue running. It
should be straightforward for existing applications to migrate to JDBC
4.0 technology.