JDBC 2.0 and a New Approach for Updating Records

JDBC 2.0 ResultSets have two new features that increase their flexibility in Java applications:

  • Scrollable— The ResultSet can be scrolled in both directions (rather than just forward only). Scrollable ResultsSets might be sensitive or insensitive to changes that others make to the ResultSet.

  • Updatable— The ResultSet can be edited after retrieval and then synchronized with the underlying database.

Both features are controlled by passing static variables as arguments to the Connection object's createStatement() method. For a complete list of these static variables, consult the Field Summary for java.sql.ResultSet in the javadocs.

As an example, please examine the following code fragment:

 Connection ...

Get Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.