commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [dbutils] Enhanced* classes
Date Tue, 21 Oct 2003 04:18:59 GMT

I object to deleting them, but agree they don't offer much.

They really exist as an example of the 'driver' package, and should move
into some kind of example documentation. They would make a better example
if the setLong/getLong methods do the null checking.

Switching to using DynamicProxies for driver would make more sense as it
would allow the JDBC 1/2/3 issue to become a non-issue. I plan to start
looking into this so all of the driver package may become a pre-jdk-1.3
thing and be ignored (?). Bit confused as to whether CGLib offers anything
here.

Hen

On Mon, 20 Oct 2003, David Graham wrote:

>
> --- Tomasz Pik <pikus@ais.pl> wrote:
> > David Graham wrote:
> >
> > > The Enhanced* classes don't really seem to be enhanced versions of
> > their
> > > standard counterparts.  For example, EnhancedResultSet has this
> > method:
> > >
> > > public Long getLongObject(String column) throws SQLException {
> > >     return new Long(getLong(column));
> > > }
> >
> > What about:
> >
> > public Long getLongObject(String column) throws SQLException {
> >      long result = getLong(column);
> >      if (wasNull()) {
> >          return null;
> >      } else {
> >          return new Long(result);
> >      }
> > }
> >
> > > How is that enhanced over the standard rs.getObject(col) which
> > performs
> > > automatic type conversions or new Long(rs.getLong(col)) ?
> >
> > Maybe this method check agains null too?
>
> There is a SqlNullCheckedResultSet wrapper class that assigns a default
> value for null fields.  This conforms to the ResultSet interface so it
> doesn't require casting to use it.
>
> David
>
> >
> > Regards,
> > Tomek
> >
> > > David
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message