wood burning stoves 2.0*
The moose likes Servlets and the fly likes Maintaning Query result between navigations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Maintaning Query result between navigations" Watch "Maintaning Query result between navigations" New topic
Author

Maintaning Query result between navigations

Frederik Ericsson
Ranch Hand

Joined: Apr 27, 2005
Posts: 128
Hi All,

there is one functionality in our project like, selecting set of customers based upon some criteria like date of purchase, dept, so and so...

Let us say in the first page get the dates, second page get the amount it will go upto next 4 pages , we ran the query with all the parametes from all the 6 pages and get the result to the last page. its taking long time to run it, because it really a big query with joins n very large table as well.

Now whar we are planning is when we get the date in the first page run the query and get the result, get the next parameter and run the query against the previous result with the current parameter and proceed furthur upto the last result page.

My question is

How can I store the result after running the query in each page, how to keep maintain for geting another parameter and run it ?

Its kind of confusing I know, but i would like to do it in this way..

Please do help me..

Thanks!!!
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Posts: 83

Not clear with your question so I am going to ask few .....

1. Is this a web application?
2. How much data are you thinking of storing? (Few pages means 1kb per page or so?)

3. How many users are going to use it?

In general if you are thinking of storing the data in memory you are basically looking for a caching technique.
A simple caching can be implemented using Hashtable if you already have a unique id available for each page and data.... not sure this is what you are looking for....


Web Development Tips and Tutorials - By Sachin
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
How can I store the result after running the query in each page, how to keep maintain for geting another parameter and run it ?


Sounds like a job for a custom object which holds both the query and the result.

Be sure you don't hang on to any of the JDBC result objects, they have to be properly disposed of.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maintaning Query result between navigations