Re: How set null to integer or long field

"Michael Strapp" <[email protected]> Fri, 5 Aug 2005 20:00:14 -0400
Newsgroups gmane.comp.java.enhydra.dods
Message-ID <007001c59a19$d52ec840$3401a8c0@Mike>
This is a multi-part message in MIME format...

------------=_1123286462-26505-230
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-1";
	reply-type=original
Content-Transfer-Encoding: 7bit

Hi Daniel,
    You'll need to use a javaType="java.math.BigDecimal" for your 
INTEGER/BIGINT field (with canBeNull="true").  This is actually the only 
non-primitive datatype for numbers that is supported in JDBC by its own 
setXxx() methods (in the java.sql.PreparedStatement interface) and getXxx() 
methods (in the java.sql.ResultSet interface) - which is my guess as to why 
DODS doesn't support it (yet).  Especially in the case of a BIGINT, it 
sounds like this would be the javaType you'd want.

Regards,
Mike.

P.S. to the DODS developers:  Are there any plans for extending the DODS 
code templates to support the use of the Integer, Long, Float, or Double 
wrapper classes for the javaType attribute, at some point in the future?

----- Original Message ----- 
From: "Daniel Guryca" <[email protected]>
To: <[email protected]>
Sent: Friday, August 05, 2005 5:23 AM
Subject: [dods] How set null to integer or long field


>I have a problem with setting DB field which is of type INTEGER or BIGINT.
>
> It is imposible to set this field with DO object to null value. (0 is
> saved instead of null) - because it accepts java int (long) types only.
> It is also imposible to get null value from this field. (0 is return) -
> because it gets java int (long) types only.
>
> So is there a way how to set or get a value of null for DB fields of
> type INTEGER or BIGINT?
>
> Thank you for your help.
>
>


--------------------------------------------------------------------------------


>
> --
> You receive this message as a subscriber of the [email protected] mailing 
> list.
> To unsubscribe: mailto:[email protected]
> For general help: mailto:[email protected]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
> 



------------=_1123286462-26505-230
Content-Type: text/plain; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: 8bit


--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

------------=_1123286462-26505-230--