Updatable Result Sets in JDBC
The Ingres JDBC driver supports updatable result set features of the JDBC 2.1 API. Updatable result sets permit an application to update or delete the current row of the result set, or insert rows into the associated table using methods provided by the JDBC ResultSet class. A new class, RsltUpdt, has been added as an extension to the cursor result set class, RsltCurs, to support updatable result sets. The result set methods associated with the RsltUpdt class are listed below.
The ability to update a result set is determined by calling the following method:
ResultSet.getConcurrency()
The current row of a result set can be deleted using the following method:
ResultSet.deleteRow()
Columns values of the current row can be set using the following methods:
ResultSet.updateAsciiStream()
ResultSet.updateBigDecimal()
ResultSet.updateBinaryStream()
ResultSet.updateBoolean()
ResultSet.updateByte()
ResultSet.updateBytes()
ResultSet.updateCharacterStream()
ResultSet.updateDate()
ResultSet.updateDouble()
ResultSet.updateFloat()
ResultSet.updateInt()
ResultSet.updateLong()
ResultSet.updateNull()
ResultSet.updateObject()
ResultSet.updateShort()
ResultSet.updateString()
ResultSet.updateTime()
ResultSet.updateTimestamp()
Once column values have been set, the changes can be saved or dropped using the following methods:
ResultSet.updateRow()
ResultSet.cancelRowUpdates()
To insert a row, the result set current position must be moved to a special reserved row. The following methods control the positioning of the result set and the insertion of rows:
ResultSet.moveToInsertRow()
ResultSet.moveToCurrentRow()
ResultSet.insertRow()
The following methods can be used to determine the status of a result set row:
ResultSet.rowDeleted()
ResultSet.rowInserted()
ResultSet.rowUpdated()
For more information, see the Connectivity Guide.