O'Reilly logo

Apache Derby—Off to the Races: Includes Details of IBM® Cloudscape™ by Dan Scott, George Baklarz, Paul C. Zikopoulos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Result Sets to Modify Data

In many types of applications, users will scroll through a set of data before deciding when to update a record. The update could involve changing a value in a column or deleting an entire row. Using traditional result sets returned from an executeQuery() operation, an application can list all of the rows that are returned from a table. Unfortunately, these rows can't be updated dynamically, so the application would have to issue an UPDATE or a DELETE statement against the current row. The program would need logic similar to the following example:

 rs = s.executeQuery("SELECT * FROM TESTCURSOR"); while (rs.next()) { ... populate display with all records found ... } ... user selects a record to delete ... rs = s.executeUpdate("DELETE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required