Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Paging on JSP Side vs Paging on Database side

 
Piyush Daiya
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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.

Piyush
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic