O'Reilly logo

Java Enterprise in a Nutshell, Second Edition by David Flanagan, Jim Farley, William Crawford

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

Name

ResultSet

Synopsis

The ResultSet interface represents a database result set, allowing programs to access the data in the result set. ResultSet objects are usually generated by the execute(), executeUpdate(), and executeQuery() methods of Statement and PreparedStatement. They are also returned by certain metadata methods.

The JDBC 1.0 ResultSet allows you to scroll navigate through the data once from beginning to end, iterating through rows using the next() method and retrieving individual fields using the getXXX() methods. The getMetaData() method returns a ResultSetMetaData object that describes the structure of the underlying data.

JDBC 2.0 introduces a number of new features: including complete scrolling capabilities (the previous(), first(), last(), and related methods), direct updating of data via the updateXXX() methods, and insertion of new data rows using the insertRow() method. JDBC 3.0 adds updater methods for BLOBs, CLOBs, Refs, and URL s.

public interface ResultSet {
// Public Constants
   public static final int CLOSE_CURSORS_AT_COMMIT;              // =2, 1.4
   public static final int CONCUR_READ_ONLY;                     // =1007, 1.2
   public static final int CONCUR_UPDATABLE;                     // =1008, 1.2
   public static final int FETCH_FORWARD;                        // =1000, 1.2
   public static final int FETCH_REVERSE;                        // =1001, 1.2
   public static final int FETCH_UNKNOWN;                        // =1002, 1.2
   public static final int HOLD_CURSORS_OVER_COMMIT;             // =1, 1.4
   public static final int TYPE_FORWARD_ONLY;                    // =1003, 1.2
   public static final int TYPE_SCROLL_INSENSITIVE ...

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