views:

58

answers:

3

We have a simple table with employee data containing a 100k records. We want to display them using pagination on a simple JSP page with helper class/bean.

On one page we'll display 50 records.

Shall I fetch 50 records as per the page number & display them/ Use some other alternative?

What should be the best design approach to this problem?

A: 

There are many paginators for java server page. You can use one of them and display some records on the pages. For paging you can use for example - jsptags paginator

shk
A: 

You might want to do the paging with database & using cache for reduce the data accessing to database.refer: http://onjava.com/pub/a/onjava/excerpt/jebp_3/index2.html "Cache on the server"

jebberwocky
Thanks for the comment
Rohit Desai
you are welcome
jebberwocky
A: 

100k records thats mean 50 X 2000 or could i say it need 2000page to see all record. if u use pagination and dispaly pagination completly using first, previous, next, last and number each page it will be harmfull. cause @1st u must count all record, it spend more time in your query to load @2nd u must make a algorith to display it on your view.my advice is using pattern that was facebook and twiit use..on pagination only use next and previous.it will be simple and reduce page load time.

thanks

MbahSaptoJr