pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Valentin Rodionov <valiar@scripps.edu>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: setObject(i,null) and general "setNull" problems
Date: Tue, 22 Feb 2005 13:19:51 +1300
Message-ID: <421A7AA7.9040303@opencloud.com> (raw)
In-Reply-To: <e4993f12cf78d4a981efc4bad3accbd6@scripps.edu>
References: <e4993f12cf78d4a981efc4bad3accbd6@scripps.edu>

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



view thread (4+ messages)  latest in thread

Message-ID: <421A7AA7.9040303@opencloud.com>
Permalink:  ../421A7AA7.9040303@opencloud.com/
Also on:    postgresql.org/message-id/421A7AA7.9040303@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, valiar@scripps.edu
  Subject: Re: setObject(i,null) and general "setNull" problems
  In-Reply-To: <421A7AA7.9040303@opencloud.com>
  References: <e4993f12cf78d4a981efc4bad3accbd6@scripps.edu> <421A7AA7.9040303@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