commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <>
Subject Re: [DBCP] getting the underlying result set for Blob processing
Date Wed, 12 Feb 2003 12:38:42 GMT
On Tue, 11 Feb 2003, Kevin HaleBoyes wrote:

> It is a real shame that I have to do this.  Not only is my webapp
> now dependant on Oracle it also has to know about
> DelegatingResultSet and that I'm using DBCP.  At least it's all
> tucked away into a DAO class and doesn't effect the rest of the
> application.

Agreed.  One way of minimizing the dependency on DBCP here is to use a
utility method like this:

public ResultSet toUnderlyingResultSet(ResultSet rset) {
  while(rset instanceof DelegatingResultSet) {
    rset = ((DelegatingResultSet)rset)).getDelegate();
  return ResultSet;

and use it like:

OracleResultSet orset = (OracleResultSet)(toUnderlyingResultSet(rset));

(of course, you could embed the cast to Oracle in that method as well).

This will make DBCP a compile-time, but not a run-time, dependency, which
I would recommend (since a simple configuration change can turn pooling on
and off)

View raw message