1.

How To Insert And Delete A Row Programmatically? (new Feature In Jdbc 2.0)

Answer»

Make sure the resultset is updatable.
1. MOVE the cursor to the SPECIFIC position.

uprs.moveToCurrentRow();

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.

uprs.insertRow();

To DELETE a row: move to the specific position and call deleteRow() method:

uprs.absolute(5);
uprs.deleteRow();//delete row 5

To SEE the changes call refreshRow();

uprs.refreshRow();

Make sure the resultset is updatable.
1. move the cursor to the specific position.

2. set value for each column.

3. call inserRow() method to finish the row insert process.

To delete a row: move to the specific position and call deleteRow() method:

To see the changes call refreshRow();



Discussion

No Comment Found