Skip site navigation (1) Skip section navigation (2)

Re: setObject(i,null) and general "setNull" problems

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Valentin Rodionov <valiar(at)scripps(dot)edu>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: setObject(i,null) and general "setNull" problems
Date: 2005-02-22 00:19:51
Message-ID: 421A7AA7.9040303@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

pgsql-jdbc by date

Next:From: Valentin RodionovDate: 2005-02-22 00:49:17
Subject: Re: setObject(i,null) and general "setNull" problems
Previous:From: Kris JurkaDate: 2005-02-21 23:15:14
Subject: Re: setObject(i,null) and general "setNull" problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group