简体   繁体   English

在Java 7上使用Apache Commons DBCP 1.4可能会出现什么问题?

[英]What problems could occur using Apache Commons DBCP 1.4 on Java 7?

The Apache Commons DBCP overview page states: Apache Commons DBCP概述页面指出:

DBCP 2.0 compiles and runs under Java 7 only (JDBC 4.1)
DBCP 1.4 compiles and runs under Java 6 only (JDBC 4)
DBCP 1.3 compiles and runs under Java 1.4-5 only (JDBC 3)

DBCP 2.0 binaries should be used by applications running under Java 7.
DBCP 1.4 binaries should be used by applications running under Java 6.
DBCP 1.3 should be used when running under Java 1.4 5.

What problems could occur using Apache Commons DBCP 1.4 on JVM 7 (from an application compiled with JDK 7)? 在JVM 7上使用Apache Commons DBCP 1.4(来自使用JDK 7编译的应用程序)可能会出现什么问题?

The above restrictions are related to the evolution of the JDBC APIs. 上述限制与JDBC API的发展有关。

If you have a look at the java.sql.Connection interface and search for the "Since:" markers you will see that additional methods were added to it in Java 6, and more in Java7. 如果您查看java.sql.Connection接口并搜索“Since:”标记,您将看到在Java 6中添加了其他方法,在Java7中添加了更多方法。

The nature of DBCP means that it will be providing it's own implementation of java.sql.Connection (amongst others I expect), and it needs to implement the new interfaces for the newer Java versions. DBCP的本质意味着它将提供它自己的java.sql.Connection实现(以及我期望的其他实现),并且它需要为较新的Java版本实现新的接口。

So, using DBCP 1.4 under Java7 will likely lead to InstantionErrors or similar. 因此,在Java7下使用DBCP 1.4可能会导致InstantionErrors或类似问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM