Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

CHAPTER 7: Result Sets Explored > Updating, Inserting, and Deleting Result Set ...

Updating, Inserting, and Deleting Result Set Rows

Assuming that you have a result set with a concurrency type of ResultSet.CONCUR_UPDATABLE, you can directly update rows in the result set, insert rows into the result set, or delete rows from the result set.

After an update or insert operation in a result set, you propagate the changes to the database in a separate step that you can skip if you want to cancel the changes. A delete operation in a result set, however, is immediately executed (but not necessarily committed) in the database. Let's look at each of these, starting with the delete operation.

Deleting a Row

To delete the current row, you can invoke the method deleteRow() on the result set:

void deleteRow() throws SQLException;

Updating a Row


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint