| 1546 | } |
| 1547 | |
| 1548 | private static boolean moveCursor(ResultSet results, int offset) throws SQLException { |
| 1549 | boolean cursorAtRow = true; |
| 1550 | if (results.getType() == ResultSet.TYPE_FORWARD_ONLY) { |
| 1551 | int i = 1; |
| 1552 | while (i++ < offset && cursorAtRow) { |
| 1553 | cursorAtRow = results.next(); |
| 1554 | } |
| 1555 | } else if (offset > 1) { |
| 1556 | cursorAtRow = results.absolute(offset - 1); |
| 1557 | } |
| 1558 | return cursorAtRow; |
| 1559 | } |
| 1560 | |
| 1561 | /** |
| 1562 | * Performs the given SQL query calling the given <code>rowClosure</code> with each row of the result set starting at |