A database query retu开发者_如何学运维rns a large ResultSet, and I would like to page the result, something like a cursor where I can choose how many results to retrieve and then in a next loop retrieve the remainders. What is the best way to do this?
Thanks
You may try javax.sql.rowset.CachedRowSet.
CachedRowSet crs = CachedRowSetImpl();
crs.setPageSize(100);
crs.execute(conHandle);
while(crs.nextPage()) {
while(crs.next()) {
}
}
Do you want to display large ResultSet by multiple pages? I think may be you can use mysql syntax LIMIT.
精彩评论