Package org.h2.result
Class UpdatableRow
java.lang.Object
org.h2.result.UpdatableRow
This class is used for updatable result sets. An updatable row provides
functions to update the current row in a result set.
-
Constructor Summary
ConstructorsConstructorDescriptionUpdatableRow(JdbcConnection conn, ResultInterface result) Construct a new object that is linked to the result set. -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete the given row in the database.voidInsert a new row into the database.booleanCheck if this result set is updatable.Value[]Re-reads a row from the database and updates the values in the array.voidUpdate a row in the database.
-
Constructor Details
-
UpdatableRow
Construct a new object that is linked to the result set. The constructor reads the database metadata to find out if the result set is updatable.- Parameters:
conn- the database connectionresult- the result- Throws:
SQLException- on failure
-
-
Method Details
-
isUpdatable
public boolean isUpdatable()Check if this result set is updatable.- Returns:
- true if it is
-
readRow
Re-reads a row from the database and updates the values in the array.- Parameters:
row- the values that contain the key- Returns:
- the row
- Throws:
SQLException- on failure
-
deleteRow
Delete the given row in the database.- Parameters:
current- the row- Throws:
SQLException- if this row has already been deleted
-
updateRow
Update a row in the database.- Parameters:
current- the old rowupdateRow- the new row- Throws:
SQLException- if the row has been deleted
-
insertRow
Insert a new row into the database.- Parameters:
row- the new row- Throws:
SQLException- if the row could not be inserted
-