db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: SQL Exception
Date Wed, 01 Mar 2006 19:21:08 GMT
>>>>>>>>>>>> Craig L Russell wrote (2006-03-01 10:02:58):
> I have to say I don't understand the rationale for throwing an  
> exception here. Looking at the stack trace, I agree with Bernt that  
> the user is calling setObject(column, null). What I don't agree with  
> is that there is any ambiguity as to what the user means.
> The setObject javadoc sez:
> The JDBC specification specifies a standard mapping from Java Object  
> types to SQL types. The given argument will be converted to the  
> corresponding SQL type before being sent to the database....This  
> method throws an exception if there is an ambiguity, for example, if  
> the object is of a class implementing more than one of the interfaces  
> named above.

I actually agree with Craig that there is no ambiguity "as to what the
user means" (at least if the null was intentional and not a bug).

But formally Java "null" and SQL "NULL" is two different concepts. In
addition, the tutorial (3.0 ed.) has the same interpretation as me.

Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

View raw message