views:

13

answers:

0

I'm migrating some code from Python to Jython, and it currently uses MySQLdb.cursors.SSCursor to fetch the rows one by one instead of loading them into memory in bulk.

In Jython, I'm using zxJDBC to connect to the database, but I see no reference to SSCursor, and very few search results for zxJDBC and TYPE_FORWARD_ONLY, which is the Java parlance for this.

What is the way to fetch rows the same way in zxJDBC?

Update

After examining the source, it seems that I need to create the cursor like this:

cursor = connection.cursor(True, java.sql,ResultSet.TYPE_FORWARD_ONLY,
                      java.sql.ResultSet.CONCUR_READ_ONLY)

However, this still seems to fetch all the rows at once.