Prakasan OK wrote:
>
> Hi All,
>      I want to split the resultset values into different parts.
> I want to display the 10 results first and if the user clicks next
> button
> i would like to display the next 10 results  and so on similar
> to the search results in Google. Any idea about how this can be done
> using JSP?

First of all, you should save the query result in some other data
structure than the ResultSet, for instance a Vector with a Hashtable
for each row. The reason is that hanging on to the ResultSet for a
long time (over multiple requests) makes it impossible to use a
connection pool in an efficient manner. And you do use a pool, don't
you? You save the data structure in the session scope, so it's
available to multiple requests for different subsets.

Besides looping through the first 10 (or so) rows and generate the
HTML, you need to generate a "page index", i.e. links to a page that
displays 10 rows starting from a specific index. The URL for each index
page should contain a parameter that specifies the start index.

If you're interested in a commercial JSP tag library that helps you
with all of this, take a look at our InstantOnline Basic (IOB) product:

  <http://www.gefionsoftware.com/InstantOnline/Basic/>

The Threaded Discussion demo application shows how you can do this
with IOB.

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.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