Mail Archive Home | enhydra List | August 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
That's not quite true. The following code will set specific BigInt
fields to NULL. It's a workaround.
DBConnection dbc = Enhydra.getDatabaseManager().allocateConnection();
dbc.setAutoCommit(false);
// 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
else
ps2.setNull(2,Types.BIGINT); //bidid
ps2.executeUpdate();
...
dbc.commit()
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...
>
> Greetings.
>
> Alfred
>
> -----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
> in DODS
> Betreff: [enhydra] How set null value to integer or long DB field in
> DODS
>
>
> 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.
>
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.