• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Maintaning Query result between navigations

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Ranch Hand
Posts: 83
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic