File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes About Pagination in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "About Pagination in JSP" Watch "About Pagination in JSP" New topic

About Pagination in JSP

Ram kanana
Ranch Hand

Joined: Apr 13, 2006
Posts: 34
i have nearly 1000 records, and i paginate with my own code in that i retriew all the records(1000) from database and stored in a session. And finally show page wise with 10 records per page.

But i found another way, instead of getting whole records from the database retriew particular data for the page and when click next page it gets the particular data from the database.

Which way is better or what is proper way for feasibility and quick response. Because the first one make time consuming
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286

There are many good ways of doing pagination. And it's been discussed here on many occasions. A search in the JSP forum will show you past discussions. I can tell you right now that putting 1000 records worth of data in the session is usually not a good idea.

GenRocket - A Test Data Generation Platform
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 9315

Infact, You will find it being discussed in the JSp FAQ at PaginationOrPaging

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: About Pagination in JSP
Similar Threads
Display datas on Jsp Page from the Database
passing parameters between servlets and applets
Selecting random records
Getting random records
Retriew the values from the database using Struts2.