commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject Re: [DBCP] Possible strategy for multiple JDBC version support
Date Wed, 05 Jun 2013 11:42:46 GMT
Hi Jochen,

Jochen Wiedmann wrote:

> On Tue, Jun 4, 2013 at 11:29 AM, sebb <> wrote:
>> DBCP is complicated to release, because the source has to be
>> pre-processed in order to build additional versions of the code.
>> (unlike the rest of Java, JDBC is not generally upwards compatible).
> Alternative proposal (worked for me in the past in similar situations):
> Create the instances of Connection, Statement, etc. using
> java.lang.reflect.Proxy, with a suitable InvocationHandler. The instances
> generated by Proxy are implementing the runtime version of the respective
> interface, hence no compatibility problems. The InvocationHandler doesn't
> implement anything, hence can adjust its behaviour at runtime to the
> proper JDBC version.

This is here not possible, since we provide *implementations* that implement 
the affected interfaces. E.g. Statement interface has more methods which 
have arguments of types that are not even present in the older JDBC version 
i.e. you cannot even compile this source with the older JDK. Therefore all 
this filtering.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message