Hans Bergsten wrote:
>
> Prakasan OK wrote:
> >
> > i would like to display the next 10 results  and so on similar
> > to the search results in Google.
>
> First of all, you should save the query result in some other data
> structure than the ResultSet
>

 Unless you're talking about many users with large result
sets, in which case caching the results in server memory
might not work out so well. (Example: google. Thousands of
users at a time, 100,000's of results per user, most users
won't even look at anything except the first few pages, so
possibly a bad candidate for the save-the-entire-result-set
approach)

 Some databases, like MySQL, have a non-standard extension
(designed just exactly for this case) where you can request
ranges within a result set.

 Other considerations: do the results need to be consistent?
That is, if you get page 1, then wait 2 hours and somebody
changes the database, and then request page 2, is it ok to
show new data or do you have to show the 2-hour old data?
Do you have to do updates based on the results? How many
users will you have? How many results/user? How big a
server are you planning to dedicate to the task? Etc, etc.

 Probably you can get away with save-the-entire-result-set,
but it's good to be sure in advance. There's no single
best solution, it just depends on the application...


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to