Hi,
I would like to convert a small JDBCRowsSet based application from
postgresql to apache derby, which depends on an Swing databinding
library. (SwingSet)
The library works well with PostgreSQL's and MySQL'd JDBC drivers,
however with Derby I get SQLExceptions stating:
> java.sql.SQLException: Invalid cursor state - no current row.
The problem seems to be calling updateRow() after insertRow() was
called, please see the testcase attached below.
Any idea where the problem lies, and what I can do to solve it?
Thank you in advance, Clemens
Table definition:
> CREATE TABLE testtable (ikey INTEGER PRIMARY KEY NOT NULL GENERATED BY
> DEFAULT AS IDENTITY, name VARCHAR(127))
JdbcRowSetImpl rowset = new JdbcRowSetImpl(ssConnection.getConnection());
rowset.setType(ResultSet.TYPE_SCROLL_INSENSITIVE);
rowset.setConcurrency(ResultSet.CONCUR_UPDATABLE);
rowset.setCommand("SELECT * FROM testtable");
rowset.execute();
rowset.next();
rowset.updateString("name", "1");
rowset.updateString("short", "2");
rowset.insertRow();
rowset.last();
rowset.updateRow();