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

Reply via email to