• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Paging results back to browser

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check this links:
https://coderanch.com/t/280366/JSP/java/Records-per-page
http://www.dotjonline.com/taglib/grid.jsp
cheers
 
Do not threaten THIS beaver! Not even with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic