You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Patrick Hess <pa...@ish.de> on 2004/07/05 17:19:28 UTC

[DbUtils] problem with BeanHandler

Hi there,

I'm trying at the moment to replace some my JDBC code with DbUtils. 
Currently I have a problem with the BeanHandler. I'm using an Oracle 
8.1.7 database with thin driver on JDK 1.3 on Windows.

My problem: except with the BeanHandler everything works fine, my 
results are like expected. When using the BeanHandler all numeric fields 
are 0 while string values are set. I tried different variations of the 
bean like using int, long, Integer or Long for the numeric properties.

I didn't found any references to such a problem on google so I think I 
did some mistake. Can anyone give me a hint to find out what's going on?

Thanks in advance, have a nice day
    Patrick


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


Re: [DbUtils] problem with BeanHandler

Posted by Patrick Hess <po...@pbone.biz>.
David Graham wrote:

> Download the latest nightly build and test with that.  DbUtils 1.0 shipped
> with a rather simple bean population implementation that causes this
> problem.  DbUtils 1.1 will ship with a smarter version that should handle
> numbers correctly.

I will do this right now, thanks!

> The actual cause of the problem is that Oracle is returning BigDecimal
> objects for numeric columns and your bean has an int property so DbUtils
> doesn't call the setter method.

Tried also to use long and Long and didn't worked. Tried it on hsql 
again 5 minutes ago - and didn't worked. I'm going for the nightly build 
now :)

Patrick

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


Re: [DbUtils] problem with BeanHandler

Posted by David Graham <gr...@yahoo.com>.
Download the latest nightly build and test with that.  DbUtils 1.0 shipped
with a rather simple bean population implementation that causes this
problem.  DbUtils 1.1 will ship with a smarter version that should handle
numbers correctly.

The actual cause of the problem is that Oracle is returning BigDecimal
objects for numeric columns and your bean has an int property so DbUtils
doesn't call the setter method.

David


--- Patrick Hess <pa...@ish.de> wrote:
> 
> Hi there,
> 
> I'm trying at the moment to replace some my JDBC code with DbUtils. 
> Currently I have a problem with the BeanHandler. I'm using an Oracle 
> 8.1.7 database with thin driver on JDK 1.3 on Windows.
> 
> My problem: except with the BeanHandler everything works fine, my 
> results are like expected. When using the BeanHandler all numeric fields
> 
> are 0 while string values are set. I tried different variations of the 
> bean like using int, long, Integer or Long for the numeric properties.
> 
> I didn't found any references to such a problem on google so I think I 
> did some mistake. Can anyone give me a hint to find out what's going on?
> 
> Thanks in advance, have a nice day
>     Patrick
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 

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