pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Iain <iain@mst.co.jp>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: tightening up on use of oid 0
Date: Thu, 14 Oct 2004 15:40:03 +1300
Message-ID: <416DE703.8080202@opencloud.com> (raw)
In-Reply-To: <007101c4b195$b911a000$7201a8c0@mst1x5r347kymb>
References: <41660A56.5000107@opencloud.com>
	<4167BC1A.4070809@opencloud.com>
	<Pine.BSO.4.56.0410120027040.9158@leary.csoft.net>
	<416C3E22.9080605@opencloud.com>
	<Pine.BSO.4.56.0410121550580.7695@leary.csoft.net>
	<416CF557.2040000@opencloud.com>
	<001901c4b112$e9c38890$7201a8c0@mst1x5r347kymb>
	<416DB1CA.5090005@opencloud.com>
	<007101c4b195$b911a000$7201a8c0@mst1x5r347kymb>

Iain wrote:
> Hi Oliver,
> 
> Just out of interest, is the case you marked,
> 
>>   setObject(i, (Integer)null);     // (*)
> 
> equivalent to
> 
>    Integer someInteger = null;
>    setObject(i, someInteger);
> 
> ?

Yes.

> I would ask the question then, is there any situation where there is no 
> alternative to the insufficiantly typed calls you listed?

I think there is always an alternative.

For standard types you can use setNull or setObject with a type code:

   setNull(i, Types.INTEGER);
   setObject(i, null, Types.INTEGER);

For extension types (classed as Types.OTHER) you can use the singleton 
NULL objects I introduced in my patch:

   setObject(i, PGline.NULL);
   setObject(i, PGline.NULL, Types.OTHER);

-O



view thread (20+ messages)  latest in thread

Message-ID: <416DE703.8080202@opencloud.com>
Permalink:  ../416DE703.8080202@opencloud.com/
Also on:    postgresql.org/message-id/416DE703.8080202@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, iain@mst.co.jp
  Subject: Re: tightening up on use of oid 0
  In-Reply-To: <416DE703.8080202@opencloud.com>
  References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <Pine.BSO.4.56.0410120027040.9158@leary.csoft.net> <416C3E22.9080605@opencloud.com> <Pine.BSO.4.56.0410121550580.7695@leary.csoft.net> <416CF557.2040000@opencloud.com> <001901c4b112$e9c38890$7201a8c0@mst1x5r347kymb> <416DB1CA.5090005@opencloud.com> <007101c4b195$b911a000$7201a8c0@mst1x5r347kymb> <416DE703.8080202@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox