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

Paging results back to browser

Bob Baker

Joined: Mar 22, 2002
Posts: 7
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

Joined: Mar 06, 2001
Posts: 13459

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)
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

this serach (no idea if the link will work, searched for "+result +set +paging")
returned this thread, which is one of my favourites.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
check this links:

I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
I agree. Here's the link:
subject: Paging results back to browser
It's not a secret anymore!