X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4050C32BCAD for ; Wed, 13 Oct 2004 23:56:26 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62498-07 for ; Wed, 13 Oct 2004 22:56:14 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 73818329F3F for ; Wed, 13 Oct 2004 23:56:14 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CHrzQ-0007RV-00; Thu, 14 Oct 2004 11:53:00 +1300 Message-ID: <416DB1CA.5090005@opencloud.com> Date: Thu, 14 Oct 2004 11:52:58 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Iain Cc: Kris Jurka , pgsql-jdbc@postgresql.org Subject: Re: tightening up on use of oid 0 References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <416C3E22.9080605@opencloud.com> <416CF557.2040000@opencloud.com> <001901c4b112$e9c38890$7201a8c0@mst1x5r347kymb> In-Reply-To: <001901c4b112$e9c38890$7201a8c0@mst1x5r347kymb> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/128 X-Sequence-Number: 11233 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 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