commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomasz Pik <pi...@ais.pl>
Subject Re: [dbutils] Enhanced* classes
Date Mon, 20 Oct 2003 16:10:51 GMT
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?

Regards,
Tomek

> David




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