ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google

Mail Archive Home | enhydra List | August 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: AW: [enhydra] How set null value to integer or long DB field in DODS


Alfred was talking about using DODs.
If you use a PreparedStatement to do it there is no doubt that it will work.
If i understood correctly that wasnt the ideia.

Best regards.
João Paulo Ribeiro

Steve Riley wrote:
That's not quite true. The following code will set specific BigInt
fields to NULL. It's a workaround.

DBConnection dbc = Enhydra.getDatabaseManager().allocateConnection();


// For bid or salesorder, need some integer fields to be null
PreparedStatement ps2 = ((EstimateDO)eiDO).getInsertStatement(dbc);
if (order.isBid())
    ps2.setNull(3,Types.BIGINT);    //salesordid
ps2.setNull(2,Types.BIGINT);    //bidid


On Fri, 2005-08-05 at 18:11 +0200, Madl Alfred - Together AT wrote:
Hi !

This is a rather old DODS issue. You simply can not set datatypes to
NULL that are mapped to Java primitive types...I think we should address
this issue in one of the next DODS releases...



-----Ursprüngliche Nachricht-----
Von: Daniel Guryca [mailto:daniel.guryca@xxxxxxxxxx] 
Bereitgestellt: Freitag, 05. August 2005 13:56
Bereitgestellt in: Enhydra
Unterhaltung: [enhydra] How set null value to integer or long DB field
Betreff: [enhydra] How set null value to integer or long DB field in

I have a problem with setting DB field which is of type INTEGER or

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 

Thank you for your help.



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

João Paulo Ribeiro | Senior Software Engineer

PHONE: + 351 253 305 250 
FAX  : + 351 253 305 250

About Solutions | Wireless World

CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender. 
DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.

<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.