ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugeny N Dzhurinsky <b...@redwerk.com>
Subject Re: Exception while setting properties
Date Wed, 16 Aug 2006 16:06:12 GMT
On Wed, Aug 16, 2006 at 07:22:22AM -0600, Larry Meadors wrote:
> 
>    So does this make the error go away?

Yep.

>    If the database allows null values, you really don't want to use an
>    int - and you are discovering why.
>    Even with JDK5 and auto-boxing, if you try to assign a null to an int,
>    you will get an NPE. So the only way around it is to assign a magic
>    number ( i.e., 0) to mean null, which IMO is a retarded thing to do on
>    purpose, but in some cases is the only way.

I thought that would work in a way as in ResultSet - for null values when
casting to int will result in 0

-- 
Eugene N Dzhurinsky

Mime
View raw message