Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintaning Query result between navigations

 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic