The Artima Developer Community
Sponsored Link

Java Answers Forum
Problem with Paging

3 replies on 1 page. Most recent reply: Apr 8, 2002 4:09 AM by Thomas SMETS

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Devi prasad

Posts: 2
Nickname: sudheer
Registered: Apr, 2002

Problem with Paging Posted: Apr 3, 2002 4:36 AM
Reply to this message Reply
Advertisement
hi all,
I got the resultset which is having 100 records.
While showing it in the page it is tedious with scrollbar.
But i want to show 10 records per page.
I want the sample code in jsp.
Iam using oracle8i as database.
can anybody help in this big world.
if any, send to deviprasad@knowsys.net

Regds
Sudheer


Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Problem with Paging Posted: Apr 5, 2002 4:07 AM
Reply to this message Reply
Well there is plenty of possible answers for that ....

Either, you add in your SQL a LIMIT clause
Or, you use the JDBC2 special feature to limit the size of you ResultSet

thomas,

Devi prasad

Posts: 2
Nickname: sudheer
Registered: Apr, 2002

Re: Problem with Paging Posted: Apr 8, 2002 3:55 AM
Reply to this message Reply
Hi thomas,

According to you, we can view certain number of records from a whole.we can't view the remaining records.Actually, my problem is i want to view all the records with 10 0r 5 records per page with previous and next buttons.

reply me.

Rgds
Sudheer

Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Problem with Paging Posted: Apr 8, 2002 4:09 AM
Reply to this message Reply
There is on every DataBase the noton of a Cursor.
Just learn what they mean & try to use the syntax accordingly.

On postgreSQL you can have the following syntax :

SELECT customer_id from CUSTOMER ORDER BY customer_id LIMIT 3;


or, say you want the 5th to the 10th :

SELECT customer_id from CUSTOMER ORDER BY customer_id LIMIT 5 OFFSET 5;


The notion of CURSOR is present on any relevant DB (Oracle, Sybase, Informix, SQLserver, ...).
JDBC 2 allows you to include the ResultSet browsing in the Java code, too !

Thomas,
tsmets @ lautre . net

Flat View: This topic has 3 replies on 1 page
Topic: html and applets Previous Topic   Next Topic Topic: Redirecting System.out.println

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use