commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: [dbutils] Enhanced* classes
Date Tue, 21 Oct 2003 05:07:03 GMT

----- Original Message -----
From: "Henri Yandell" <bayard@generationjava.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Tuesday, October 21, 2003 7:18 AM
Subject: Re: [dbutils] Enhanced* classes


>
> 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.

It is possible to use CGLib for jdk1.2, but I do not think it is a good idea
to add dependancy
for this feature only, JDBC decorators need nothing more than jdk Proxy and
can run without security configuration.


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


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