summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/repo/jdbc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/jdbc')
-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;
}
}