ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From al pivonka <AL_PIVO...@YAHOO.COM>
Subject Re: Exception while setting properties
Date Wed, 16 Aug 2006 16:10:24 GMT
How to un-subscribe from this list?
Al Pivonka

Those who say it can't be done,
are usually interrupted by those doing it.

----- Original Message ----
From: Eugeny N Dzhurinsky <bofh@redwerk.com>
To: user-java@ibatis.apache.org
Sent: Wednesday, August 16, 2006 12:06:12 PM
Subject: Re: Exception while setting properties

On Wed, Aug 16, 2006 at 07:22:22AM -0600, Larry Meadors wrote:
>    So does this make the error go away?


>    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

View raw message