db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Klebanoff <kleba...@Mutagen.Net>
Subject Re: JDBC spec question for ResultSet.updateObject method
Date Tue, 25 Jan 2005 17:06:35 GMT
Mamta Satoor wrote:

>Hi,
>
>The JDBC API Tutorial and Reference book says that
>"The method setObject (on PreparedStatement) can take a null value only if
>the JDBC type is specified".
>But I couldn't find anything similar for ResultSet.updateObject(int columnIndex, Object
x).
>Should this method throw an exception if null is passed for the Object since there is
no
>way to specify JDBC type for this particular signature of updateObject?
>
>thanks,
>Mamta
>
>  
>
I suspect that a PreparedStatement may not always be able to decide on 
the type of a parameter when it compiles a statement, or it may not be 
able to do so easily. So PreparedStatement.setObject( i, null) may have 
trouble deciding how to handle the null. However a ResultSet knows the 
types of all of its columns, so ResultSet.updateObject( i, null) should 
treat the null as being of the type of the underlying column, which it 
knows.

Jack

Mime
View raw message