1.1.1

Table Of Contents
/** a standard JDBC ResultSet. It maintains a
* cursor that points to the current row of data. The cursor
* moves down one row each time the method next() is called.
* You can scroll one way only--forward--with the next()
* method. When auto-commit is on, after you reach the
* last row the statement is considered completed
* and the transaction is committed.
*/
System.out.println( "last name" + "," + "first name" + ":
earnings");
/* here we are scrolling through the result set
with the next() method.*/
while (rs.next()) {
// processing the rows
String firstnme = rs.getString("FIRSTNME");
String lastName = rs.getString("LASTNAME");
BigDecimal salary = rs.getBigDecimal("SALARY");
BigDecimal bonus = rs.getBigDecimal("BONUS");
BigDecimal comm = rs.getBigDecimal("COMM");
System.out.println( lastName + ", " + firstnme + ": "
+ (salary.add(bonus.add(comm))));
}
rs.close();
// once we've iterated through the last row,
// the transaction commits automatically and releases
//shared locks
s.close();
Updatable Result Sets
You update result sets in vFabric SQLFire by using result set update methods (updateRow(),deleteRow()
and insertRow()), or by using positioned update or delete queries. SQLFire supports updatable result sets
that are both scrollable and non-scrollable (forward-only).
Requirements for Updatable Result Sets
Only specic SELECT statements- simple accesses of a single table-allow you to update or delete rows as you
step through them.
To create an updatable result set, you must use a JDBC peer client connection to execute a query that species
the FOR UPDATE clause. For more information, see SELECT on page 528 and FOR UPDATE Clause on page
533.
See also SQL Language Limitations on page 707 for information about limitations with updatable results.
Forward-Only Updatable Result Sets
A forward-only updatable result set maintains a cursor that can move in only one direction (forward), and also
update rows.
To create a forward only updatable result set, you create a statement with concurrency mode
ResultSet.CONCUR_UPDATABLE and type ResultSet.TYPE_FORWARD_ONLY.
Note: The default type is ResultSet.TYPE_FORWARD_ONLY.
Example of Forward-Only Updatable Result Set on page 177
Visibility of Changes on page 177
vFabric SQLFire User's Guide176
Developing Applications with SQLFire