I have a problem with processing all rows from database (PostgreSQL). I get an error: org.postgresql.util.PSQLException: Ran out of memory retrieving query results.
org.postgresql.util.PSQLException: Ran out of memory retrieving query results.
Use a CURSOR in PostgreSQL or let the JDBC-driver handle this for you.
LIMIT and OFFSET will get slow when handling large datasets.