After a query is run, the ResultSet object traverses the results by using the next() method.
This method can traverse the resultset and detect whether the end of the resultset is reached.
During traversal, you can use the getXXX method of the ResultSet object to extract data from the resultset. XXX corresponds to a Java data type.
Example: Traversing the ResultSet object rs, retrieving the name of each customer, and printing the names
while (rs.next()) System.out.println (rs.getString(1));
When the end of the resultset is reached, the next() method returns false. Customer names are materialized as Java String values.