This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
using setMaxRows of PreparedStatement - Paging the records ??
posted 12 years ago
Hi, I am trying to page the records in d/b using java.sql package. I need 2 records on each subsequent fetch. I got first set of records, but i could not be able to fetch next two records from d/b. This is my program hereafter..
The second setMaxRows is setting it to 4-2, which is two. So you are doing the same query (first two rows) repeatedly. I don't think this can be done completely in Java because not all databases support it. There's a good article that shows how to to it in Oracle.