db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Seebregts <to...@cibecs.com>
Subject Re: PreparedStatement setObject() and SMALLINT
Date Thu, 19 Jan 2006 06:23:19 GMT
Hi Mamta,

Hmmm ... sounds like an oversightin the JDBC 3.0 spec to me, but hey,
I'm just a peasant.

Thanks for the explanation though !

regards

Tony

> ------------------------------------------------------------------------
>
> *From:* Mamta Satoor [mailto:msatoor@gmail.com]
> *Sent:* Wednesday, January 18, 2006 8:59 AM
> *To:* Derby Discussion
> *Subject:* Re: PreparedStatement setObject() and SMALLINT
>
>  
>
> Hi Tony,
>
>  
>
> When you use setShort, the signature of the method is void
> setShort(int parameterIndex, **short** x)
>
>  
>
> But when you use void setObject(int parameterIndex,Object
> <http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html> x),
> you are passing an instance of java type **Short **which is not one of
> the acceptable Java Types for JDBC type SMALLINT (JDBC 3.0
> specification has a data type conversion section. In that section, it
> shows BigDecimal, Boolean, Integer, Long, Float, and Double as the
> acceptable java types for JDBC SMALLINT.) So, I think what you are
> running into is Derby behavior as per the JDBC specification,
>
>  
>
> Mamta
>
>

Mime
View raw message