From: Bertrand R. <ber...@mo...> - 2004-03-24 21:33:14
|
> Bertrand, >=20 > On Wed, 2004-03-24 at 21:12, Bertrand Renuart wrote: >=20 > > You point to another (easier) solution: the ability for people to=20 > > *inject* interfaces in our proxy class. > >=20 > > They could define an interface containing the signature of=20 > the methods=20 > > they want from the vendor jdbc connection (rs and st as well); then=20 > > register this extra interface with proxool. >=20 > 1. > <proxool> > <alias>my-oracle-pool</alias> > <driver-url>jdbc:oracle...</driver-url> > <driver-class>oracle.jdbc.OracleDriver</driver-class> > <connection-interface> > com.outside.jdbc.StrangeConnectionIF > </connection-interface> > </proxool> >=20 > 2. > public interface StrangeConnectionIF { > public void foo(); > } >=20 > 3. > Connection c =3D DriverManager.getConnection(url, properties); > StrangeConnectionIF sc =3D (StrangeConnectionIF) c; > sc.foo(); >=20 > Like that? >=20 Yes, something like that. Would be cool, no? Except, to be easy to use, the StrangeConnectionIF should somehow extend java.sql.Connection - otherwise the guy will have to recast all the time = - but this is up to him to sort it out ;-) BUT, you then have to be carefull when building your proxy because you = may have several interfaces to implement that extend the same parent (java.sql.Connection) - not sure it is a problem... And we should also include the following extensions: <resultset-interface> com.outside.jdbc.StrangeResultSetIF </resultset-interface> <statement-interface> com.outside.jdbc.StrangeStatementIF </statement-interface> In any case, if this is not enough - remains the ConnectionBuilder = extension point (which is working btw)... Proxool becomes more and more open ;) Remark: I'm +100K in favor of the two solutions described in this thread rather = than exposing the *real* connection to the user... |