Domanda

The Apache Commons DBCP overview page states:

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)?

È stato utile?

Soluzione

The above restrictions are related to the evolution of the JDBC APIs.

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.

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.

So, using DBCP 1.4 under Java7 will likely lead to InstantionErrors or similar.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top