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

João Paulo Ribeiro <[email protected]> Fri, 05 Aug 2005 19:09:01 +0100
Newsgroups gmane.comp.java.enhydra.general
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1123265354-26505-180
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi!<br>
<br>
Alfred was talking about using DODs. <br>
If you use a PreparedStatement to do it there is no doubt that it will
work.<br>
If i understood correctly that wasnt the ideia.<br>
<br>
Best regards.<br>
João Paulo Ribeiro<br>
<br>
<br>
<br>
<br>
Steve Riley wrote:
<blockquote
 cite="[email protected]"
 type="cite">
  <pre wrap="">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:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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 [<a class="moz-txt-link-freetext" href="mailto:[email protected]">mailto:[email protected]</a>] 
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.

    </pre>
  </blockquote>
  <pre wrap=""><!---->

  </pre>
  <pre wrap="">
<hr size="4" width="90%">

--
You receive this message as a subscriber of the <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> mailing list.
To unsubscribe: <a class="moz-txt-link-freetext" href="mailto:[email protected]">mailto:[email protected]</a>
For general help: <a class="moz-txt-link-freetext" href="mailto:[email protected]?subject=help">mailto:[email protected]?subject=help</a>
ObjectWeb mailing lists service home page: <a class="moz-txt-link-freetext" href="http://www.objectweb.org/wws">http://www.objectweb.org/wws</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
João Paulo Ribeiro | Senior Software Engineer
<a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>

PHONE: + 351 253 305 250 
FAX  : + 351 253 305 250
<a class="moz-txt-link-abbreviated" href="http://www.mobicomp.com">www.mobicomp.com</a>
 
________________________________________________________________

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.</pre>
</body>
</html>


------------=_1123265354-26505-180
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

------------=_1123265354-26505-180--