Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Paging results back to browser

 
Bob Baker
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My current application requires me to provide a "scrollable" set of results if those results number more than a page of a small set (say, 10).
Something like "Pages : 1 2 3 4 5", etc., with each number being a link to the corresponding page of results.
What is the best way to handle this? I would think that using a collection of beans, with each bean representing a result from that database, would do the trick.
Is this the best way, or is there another way? Are there any code samples/examples anywhere so I can get an idea of how to do it?
I am not using a version of JDBC that supports scrollable ResultSets.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no 'best solution' for this problem, it depends too heavily on your requirements.
(eg if you are gathering indexes only you might store them on the session, but if you are loading large amounts of data you don't want this on the session)
There have been a number of good discussions in the Servlets, JSP and JDBC forums and I recommend a search first. (I'll have a look and post some links if I get a chance)
Dave
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this serach (no idea if the link will work, searched for "+result +set +paging")
returned this thread, which is one of my favourites.
Dave
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this links:
http://www.coderanch.com/t/280366/JSP/java/Records-per-page
http://www.dotjonline.com/taglib/grid.jsp
cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic