Browse Source

PR1109 [jdbc] Fix next() interface in result iteration (#1109)

The result set of JDBC query self.rs is a JavaObject rather than an iterator, so should not use next(self.rs).

Co-authored-by: Yuanhao <yuanhalu@amazon.com>
Yuanhao Lu 5 years ago
parent
commit
baeccd42c8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      desktop/libs/librdbms/src/librdbms/jdbc.py

+ 1 - 1
desktop/libs/librdbms/src/librdbms/jdbc.py

@@ -131,7 +131,7 @@ class Cursor(object):
   def fetchmany(self, n=None):
     res = []
 
-    while next(self.rs) and (n is None or n > 0):
+    while self.rs.next() and (n is None or n > 0):
       row = []
       for c in range(self._meta.getColumnCount()):
         cell = self.rs.getObject(c + 1)