Re: tightening up on use of oid 0

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Iain <iain(at)mst(dot)co(dot)jp>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: tightening up on use of oid 0
Date: 2004-10-13 22:52:58
Message-ID: 416DB1CA.5090005@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Iain wrote:
> Hi,
>
> For my part, I've never used any of those calls.
>
> FWIW, I always use reference objects such as "Integer" as opposed to
> "int" so I've never done it that way. All calls to setObject or
> set<Anything> would always use a variable which is typed (and may be
> null) my assumption is that I avoid all such ambiguities that way.

Just to clarify.. these calls are typed:

setInt(i, 42);
setObject(i, new Integer(42));
setObject(i, new Integer(42), Types.INTEGER);
setObject(i, null, Types.INTEGER);
setNull(i, Types.INTEGER);
setObject(i, new PGline(...), Types.OTHER);

These calls are not (sufficiently) typed:

setObject(i, null);
setObject(i, (Integer)null); // (*)
setObject(i, null, Types.OTHER);
setNull(i, Types.OTHER);

Types.OTHER on its own is not specific enough to identify a particular
backend type, and Java nulls have no inherent type ('instanceof' will
always return false).

From your description it sounds like you may use the case marked (*) ?

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-10-13 23:13:37 Re: tightening up on use of oid 0
Previous Message Oliver Jowett 2004-10-13 21:06:48 Re: FW: Question about the postgres resultset implementation