moveToInsertRow
moveToInsertRow is a method of the JDBC ResultSet interface used with updatable result sets. It moves the cursor to a special row known as the insert row, which is used to construct a new row to be inserted into the database. The method does not move data into the database by itself; it prepares the ResultSet to collect values for a new row.
- The ResultSet must be scrollable and updatable, and the underlying database must support updatable result sets.
- The cursor must be positioned on a valid current row before calling moveToInsertRow.
- After moving to the insert row, use updateXXX or updateObject to set the values for the new
- Call insertRow to insert the new row into the database, and then call moveToCurrentRow to return
- If the driver or database does not support updatable result sets, moveToInsertRow may throw SQLException or
- The insert row is a temporary, non-displayed row that provides a place to specify values for a
- Only the columns you set with updateXXX or updateObject are used for insertion; others may be
- The data is committed according to the connection’s auto-commit mode or an explicit transaction.
- Obtain an updatable, scrollable ResultSet.
- rs.updateString("name", "Alice");
---