I want to read data in blocks of say 10k records from a database.
I found Result limits on wikipedia and it seems obvious that this can't done with sql in a portable way.
Another approach could be JdbcTemplate which offers many methods for queries, but how could I decide that enough rows have been read. Through the callbacks like RowMapper and ResultSetExtractor it can't be indicated, that enough data has been read.
EDIT: I was looking for a solution for JdbcTemplate
This post suggests to use setMaxRows which I had overlooked.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…