/* * Result is a ListIterator and Iterable. */ static void iteratingResults(Database db) throws DatabaseException { Result<Customer> result = db.queryObject(Customer.class, "where customer_id = ?", "ssmith"); for (Customer c : result) System.out.println(c); result = db.queryObject(Customer.class); while (result.hasNext()) System.out.println(result.next()); result = db.queryObject(Customer.class); for (Iterator it = result.iterator(); it.hasNext(); ) System.out.println(it.next()); }