commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <>
Subject Re: [beanutils] Issue with RowSetDynaClass and oracle10g drivers...
Date Wed, 15 Jun 2005 07:26:19 GMT
On Tue, 2005-06-14 at 15:20 +0200, Grégory Joseph wrote:

> When I run this with oracle10g and latest drivers (ojdbc14 version
> I believe), I get
> org.apache.commons.beanutils.ConversionException: Cannot assign value of
> type 'java.sql.Date' to property 'foo' of type 'java.sql.Timestamp'
> If you need explanations, do this:
>   ;
>             System.out.println("from resultset : " +
> rs.getObject("month").getClass().getName());
>             System.out.println("from metadata : " +
> rs.getMetaData().getColumnClassName(1));
> As you'd see if you'd try this out, the metadata says the column is of
> type java.sql.Timestamp, while the resultset says it's a java.sql.Date
> !
> Seems oracle guys think that because that behaviour is documented, it
> is fine:
> Would a Converter help us, maybe?

Method BasicDynaBean.set is the one throwing this exception. And it
doesn't use converters, so a custom converter won't help.

I suggest you subclass RowSetDynaClass and override the copy method to
fudge the conversion. 

Or maybe subclass BasicDynaBean and override the set method to handle
the problem, then subclass RowSetDynaClass and override createDynaBean
to return instances of your custom bean that handles broken Oracle

Of course if Oracle would fix their broken software that would be a much
better solution...



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message