summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2006-12-27 02:25:14 +0000
committerBrian S. O'Neill <bronee@gmail.com>2006-12-27 02:25:14 +0000
commit94edbae8a29afd61bfd7671851bce3d5b4f1075d (patch)
tree2e57889818a396670b1bf336ecb40b8357268009
parent4172b31763ca7bf32cfe39637d039913988322fd (diff)
More JDBC cursor skip bug fixes.
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java
index fc9430d..f419c0d 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java
@@ -105,26 +105,12 @@ class JDBCCursor<S extends Storable> extends AbstractCursor<S> {
return 0;
}
- ResultSet rs = mResultSet;
- if (rs == null) {
- return 0;
- }
-
- mHasNext = true;
-
int actual = 0;
while (amount > 0) {
- try {
- if (rs.next()) {
- actual++;
- amount--;
- } else {
- mHasNext = false;
- close();
- break;
- }
- } catch (SQLException e) {
- throw mStorage.getJDBCRepository().toFetchException(e);
+ if (hasNext()) {
+ actual++;
+ amount--;
+ mHasNext = false;
}
}