commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject RE: [DBUtils] Oracle Row Processor
Date Thu, 07 Jul 2005 19:48:32 GMT


--- Henry Voyer <henry.voyer@gemplus.com> wrote:

> Hi
> 
> I just created my oracle row processor.
> 
> The current implementation of BasicRowProcessor has a method
> that checks if the field is valid :
> private boolean isCompatibleType(Object value, Class type)
> 
> This method ignore dates and most important specific JDBC values.

That's not true.  The first thing that method checks is if the object is
an instance of the setter method's parameter type.  This will handle all
Objects.  The rest of the method is only needed for primitive values.

> 
> Oracle timestamp is transformed in the jdbc process into a
> oracle.sql.DATE
> object that needs to be transformed into a java.util.date .
> 
> So in order to use dates in oracle we need to add the transformation
> process
> in the row processor.

I think the method you're interested in is BeanProcessor.processColumn()
http://jakarta.apache.org/commons/dbutils/xref/org/apache/commons/dbutils/BeanProcessor.html#378

Notice that if your bean property is a java.sql.Timestamp,
ResultSet.getTimestamp() is called.  Oracle will give you a proper
Timestamp object rather than their horrible custom class.

Download a nightly DbUtils build, change your bean property to Timestamp,
and I think you'll find the default implementation works fine.

David


> 
> Regards
> 
> 
> 
> -----Original Message-----
> From: David Graham [mailto:grahamdavid1980@yahoo.com]
> Sent: Thursday, July 07, 2005 12:37 PM
> To: Jakarta Commons Users List; henry.voyer@gemplus.com
> Subject: Re: [DBUtils] Oracle Row Processor
> 
> 
> I'm not quite sure what you mean.  Can you be more specific about why
> the
> current implementation doesn't work for Oracle?
> 
> Thanks,
> David
> 
> --- Henry Voyer <henry.voyer@gemplus.com> wrote:
> 
> > Hi everyone
> >
> > Is there a free implementation of an Oracle Row processor ?
> >
> > Where can i find it ?
> >
> > Regards
> >

Get Firefox!
http://www.mozilla.org/firefox/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message