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 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


 
On 1/17/06, Tony Seebregts <[EMAIL PROTECTED]> wrote:
Hi,

Not sure if this is a bug or intentional, but invoking setObject
(parameter,value) where the column is a SMALLINT and the value is a
Short throws the following exception:

SQL Exception: An attempt was made to get a data value of type
'SMALLINT' from a data value of type 'java.lang.Short'.

Invoking setShort(..) on the same column works just fine.

regards

Tony Seebregts





Reply via email to