db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: problem with cast (null as int)
Date Mon, 03 Aug 2009 21:51:25 GMT
> Exception in thread "main" java.sql.SQLDataException: An attempt was 
> made to get a data value of type 'INTEGER' from a data value of type 'null'.

Hi Eranda,

I think this is DERBY-1938 (https://issues.apache.org/jira/browse/DERBY-1938).

Do you agree?

Can we change your program so that it calls the other version of setObject(),
so that we can pass the data type to setObject?

That is, I changed your program from

         for (int i = 1;
                 i <= rsmd.getColumnCount(); i++) {
             pSt.setObject(i, rs.getObject(i));
         }

to

         for (int i = 1;
                 i <= rsmd.getColumnCount(); i++) {
             pSt.setObject(i, rs.getObject(i), Types.INTEGER);
         }

And then the program does not give the exception.

Does this help?

thanks,

bryan


Mime
View raw message