This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 15950

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.
I agree. Here's the link:
subject: Paging on JSP Side vs Paging on Database side
Similar Threads
Pagination in Struts2
Swing vs. Web vs. ...
Dynamic Attribute assignment (in Struts)
Value Object vs. Stateful Session Bean
PAGING EJB's and jsp - Urgent help Needed