File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes how to display data page wise Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to display data page wise" Watch "how to display data page wise" New topic
Author

how to display data page wise

Praveen palukuri
Ranch Hand

Joined: Feb 10, 2005
Posts: 65
Generally in a website(or any where) we display data page wise. What is the best way to do this process ?
[ In my project every time we send a request to database whenever, we click on page but, this is not correct process. One of my friends said that we can use thirdy party tools. But we don't have such tools. Is there any way to achieve this instead of hitting database every time, bring all the data at once and store it in any object and display according to request(either using Collections or anything else) ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This is one of our most asked questions.
See:
http://faq.javaranch.com/view?PaginationOrPaging


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Praveen palukuri
Ranch Hand

Joined: Feb 10, 2005
Posts: 65
hi ben,
thank you for your reply. In which i found every time request is sent to database and more over we are using sqlserver2000.
But is it possible to achieve that with out hitting database every time(like bring all the data once and storing in any object). Since according to my concern hitting the database every time is time consuming process.
Saket Barve
Ranch Hand

Joined: Dec 19, 2002
Posts: 229

But is it possible to achieve that with out hitting database every time(like bring all the data once and storing in any object


We implemented it in the same manner for our project.

Making just one hit to the database, the data is fetched to the client-side in chunks making use of Stateful Session Bean. We noticed that this process seems to put a lot of load on the server-side. The approach will be revamped.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42927
    
  68
But is it possible to achieve that with out hitting database every time(like bring all the data once and storing in any object).


You can always cache the results on the app server as part of a user session.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to display data page wise