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 1AFE48B9BBB for ; Tue, 22 Feb 2005 00:20:17 +0000 (GMT) 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 56709-07 for ; Tue, 22 Feb 2005 00:20:05 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 1C4648B9B9A for ; Tue, 22 Feb 2005 00:20:06 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D3NmM-0000m0-00; Tue, 22 Feb 2005 13:19:54 +1300 Message-ID: <421A7AA7.9040303@opencloud.com> Date: Tue, 22 Feb 2005 13:19:51 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Valentin Rodionov Cc: pgsql-jdbc@postgresql.org Subject: Re: setObject(i,null) and general "setNull" problems References: In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/147 X-Sequence-Number: 12327 Valentin Rodionov wrote: [...] Most of this is irrelevant because the driver has already changed back to the old behaviour, as Kris has pointed out, but.. > Is there any possibility to make this "NULL typing" thing optional? I > would bet most users of the JDBC driver > don't care for typing their null values! > Even if this behavior is a part of the JDBC standard (is it?) The JDBC standard is set up so that drivers have type information for all parameters available, even if NULL. For example, see the javadoc for setNull. The users may not care, but there are cases where the driver or db can't sensibly/safely infer that type information when it needs to.. It's not clear if setObject(i,null) should be used by a spec-compliant application or not. It seems like an oversight that this isn't forbidden, as there's no other way to get an untyped NULL into the driver. I have asked the JDBC expert group to clarify this but haven't had a response yet. There are good robustness reasons for typing all your parameters, even if NULL, but it seems that noone cares about that :( -O