Reputation: 1575
I have a query with more than 3000 rows result set. I used an iterator to iterate each record. So I have to reduce the load of system and I suppose the best way is using the pagination in jsp. If anyone has a better idea I would be glad to hear it. something like fetch number or something like this. The presentation technology is struts. If you think pagination is good please help me.
Upvotes: 4
Views: 3706
Reputation: 1385
Pagination is a good idea. However, you should remember that you not only need to make it work, but you have to understand the purpose as well.
Implement the pagination. But if you implement the pagination, but still fetches the same number of rows, your purpose is defeated. You should improve your query as well. You should fetch the exact number of rows for the exact number of entries to be displayed in a single page in your pagination. This way, both your application server and database server will gain the benefit of your implementation.
Upvotes: 1
Reputation: 41200
Query database in with limit, I mean put limit in query, say 0 to 50
in first page. When request for first page then change your limit 0+(50*1) to 50+(50*1)
and for nth page it would be like 0+(50*n) to 50+(50*n)
Upvotes: 3