statement.executeQuery cursor
===

How `PreparedStatement.executeQuery` works? Does it fetch results from database and I loop through them? Or it fetches the first result, and on record.next continues the with sql query to the next row?


    ResultSet record = statement.executeQuery("select * from users");
        while (record.next()) {
        //do something
    }


thank you