1.1.1

Table Of Contents
Visibility of Changes on page 178
Conicting Operations on page 179
Examples of Scrollable, Updatable Result Sets
Example of using result set update methods to update a row:
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = stmt.executeQuery(
"SELECT FIRSTNAME, LASTNAME, WORKDEPT, BONUS " +
"FROM EMPLOYEE");
uprs.absolute(5); // update the fifth row
int newBonus = uprs.getInt("BONUS") + 100;
uprs.updateInt("BONUS", newBonus);
uprs.updateRow();
Example of using ResultSet.deleteRow() to delete a row:
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = stmt.executeQuery(
"SELECT FIRSTNAME, LASTNAME, WORKDEPT, BONUS " +
"FROM EMPLOYEE");
uprs.last();
uprs.relative(-5); // moves to the 5th from the last row
uprs.deleteRow();
Visibility of Changes
Changes caused by other statements, triggers and other transactions (others) are considered as other changes,
and are not visible in scrollable insensitive result sets.
Own updates and deletes are visible in SQLFire scrollable insensitive result sets.
Note: SQLFire handles changes made using positioned updates and deletes as own changes, so when
made via a result set's cursor such changes are also visible in that result set.
Rows inserted to the table may become visible in the result set.
ResultSet.rowDeleted() returns true if the row has been deleted using the cursor or result set. It does
not detect deletes made by other statements or transactions. Note that the method will also work for result sets
with concurrency CONCUR_READ_ONLY if the underlying result set is FOR UPDATE and a cursor was
used to delete the row.
ResultSet.rowUpdated() returns true if the row has been updated using the cursor or result set. It does
not detect updates made by other statements or transactions. Note that the method will also work for result sets
with concurrency CONCUR_READ_ONLY if the underlying result set is FOR UPDATE and a cursor was
used to update the row.
Note: Both ResultSet.rowUpdated() and ResultSet.rowDeleted() return true if the
row rst is updated and later deleted.
vFabric SQLFire User's Guide178
Developing Applications with SQLFire