db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clemens Eisserer <linuxhi...@gmail.com>
Subject Re: Calling updateRow() after insertRow() leads to "java.sql.SQLException: Invalid cursor state"
Date Fri, 26 Nov 2010 12:08:13 GMT
Hi Dag,

Thanks a lot for talking the time and writing some sample code :)

> You need to do rowset.moveToInsertRow() first, I think. Without it you
>> rowset.updateString("name", "1");
>> rowset.updateString("short", "2");
>
> There is no column called "short" in the table, should be "ikey".

Sorry, those were some left-overs when I tried to reduce production
code to a test-case in a hurry.


> Also, since you are using a scroll insensitive result set to support the
> rowset, you'd need to do another query to see the inserted row (in
> general, although you might get lucky, depending on whether the
> underlying result set has already been inserted into the Derby cache
> used to implement the insensitive semantics).

Thats it, thanks a lot - PostgreSQL's and MySQL's JDBC driver silently
append the row, even if it doesn't match the original query and
without the need to re-run the query.
Hmm, will take quite some time to make those changes, the original
code falls more or less under the "don't touch" category ^^

Thanks again, Clemens

Mime
View raw message