public List<D> next(int nbRows) throws IOException { Result[] rows = rs.next(nbRows); List<D> resultSets = new ArrayList<D>(); for (Result r : rows) { D ds = client.toEntity(r); if (ds != null) { resultSets.add(ds); } } return resultSets; }
public boolean hasNext() { if (closed) { return false; } if (next == null) { try { Result r = rs.next(); if (r == null) { return false; } next = client.toEntity(r); return next != null; } catch (IOException e) { throw new RuntimeException(e); } } return true; }