java.sql.ResultSet interface represents the data you get by executing a database query. Once you get the ResultSet you can iterate it to go over the records. For facilitating iteration, ResultSet object maintains a cursor pointing to its current row of data. Initially the cursor is positioned before the first row. There is a next() method in ResultSet that moves the cursor to the next row, returning false when there are no more rows in the ResultSet object. Table of contents Creating and iterating a ResultSet ResultSet Java example ResultSet Types in Java ResultSet Concurrency Modes ResultSet Holdability Scrollable ResultSet Java example Methods in ResultSet for cursor movement Updater methods in ResultSet Updatable ResultSet Java example Creating and iterating a ResultSet You can obtain an object of ResultSet from a Statement object, it may be a plain Statement, PreparedStatement or a CallableStatement . // From Statement ResultSet rs =
Java, Spring, Web development tutorials with examples