You can use the method setMaxRows(int) of the java.sql.Statement to limit
the number of rows and you can also use the absolute(int) method of the
java.sql.ResultSet to move to a specific row if the ResultSet is scrollable
(that's an option when creating the Statement or PreparedStatement).

With the previous two methods you can obtain the desired rows of a query.

> -----Original Message-----
> From: JOSHY MON M C [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 14, 2002 2:04 PM
> To: [EMAIL PROTECTED]
> Subject: Urgent Help needed !
>
>
> Hi All,
> Can Anybody help ?
>
> I have a Oracle 9i table named Contacts which contain about 10000 records.
I
> need to show them in a JSP page ordered by last name or first name or in
any
> other order (as per user request). But only 100 records should be shown at
a
> time. User can click "Previous" or "Next" links to see more records ( as
in
> Google/Yahoo search )
>
> I have done this by creating a temporary table. Records are sorted and
kept
> in the temporary table . But this seems to be a very slow and inefficient
> method. ( Each request involves a select from the original table, creation
> of tempory table, insertion into temp table and finally select from temp
> table. ) Can anybody suggest a better approach ?
>
> Thanks
> Joshy
>
>
===========================================================================
> 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://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>
>
> "THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
> ADDRESSEE and may contain confidential and privileged information.
> If the reader of this message is not the intended recipient,
> you are notified that any dissemination, distribution or copy of this
> communication is strictly Prohibited.
> If you have received this message by error, please notify us
> immediately, return the original mail to the sender and delete the
> message from your system."
>
>
===========================================================================
> 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://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to