JDBC Questions and Answers

How to insert and delete a row programmatically? (new feature in JDBC 2.0)

Make sure the resultset is updatable.

1. move the cursor to the specific position.

2. set value for each column.
uprs.moveToInsertRow();//to set up for insert
uprs.updateString(“col1” “strvalue”);
uprs.updateInt(“col2”, 5);

3. call inserRow() method to finish the row insert process.
To delete a row: move to the specific position and call deleteRow() method:
uprs.deleteRow();//delete row 5
To see the changes call refreshRow();