This example shows a connection object being used to fill in a selectStatement object (via createStatement()). The executeQuery() method is then called to return a resultSet object. The resultSet.next() object moves to the next row in the result set, and returns false when there are no more rows. The getInt() and getString() methods return column values from the current row, and the while loop steps through all the rows.