File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Paging on JSP Side vs Paging on Database side Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Paging on JSP Side vs Paging on Database side" Watch "Paging on JSP Side vs Paging on Database side" New topic

Paging on JSP Side vs Paging on Database side

Piyush Daiya
Ranch Hand

Joined: Jun 13, 2002
Posts: 67
I would like to compare Paging on JSP Side vs Paging on Database side.
While going thro the posts earlier, someone has suggested to page resultset by using a bean and storing the resultset in vector.the bean would require to have session scope, isnt it? I was just curious on this approach.Coming from ASP background, always we were told not use session variables if possible or use them sparingly.So, please tell me what will be the effect of using bean to store the resultset? How will it scale?
Other approach, i was just by some ppl was to do paging on the database side using scrollable cursor.always pass pagenumber and pagesize will querying the database.So, this was all u need to store in the bean extra would be pagesize and pagenumber and one would have small resultset.
Can anyone help me out?

Waiting for your reply.


"A scientist is not person who gives right answers but a person who asks right questions"
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641

If your resultset is small and the load is light, keeping it in the session won't be a big deal. But no, you don't want to keep 100000 records in RAM for each of 1000 active users. The DBMS (and/or EJB container) can do a much better job of managing data so it's there when you need it without dragging down your system.

Customer surveys are for companies who didn't pay proper attention to begin with.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Paging on JSP Side vs Paging on Database side
Similar Threads
PAGING EJB's and jsp - Urgent help Needed
Dynamic Attribute assignment (in Struts)
Swing vs. Web vs. ...
Value Object vs. Stateful Session Bean
Pagination in Struts2