• 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

Retrieving and Presenting huge data

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a query that returns millions of records from Oracle database, and
I need to present this data to the user in JSPs. I need to show this data
page by page. So I will have buttons called "Next", "Previous" in the JSP
and allow the users to navigate through the records. While pressing the
Next button I don't want to connect to database and show the next page.
Which is the best way to achieve this?

Any feedback is greatly appreciated.

Thanks,
Nagendra.
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you absolutely insist on not going back to the database, you'll have to read in all the millions of records into some data structure in your middle tier, store that in say, session state, and write JSP to access it. This can be done, but will consume lots of middle tier memory, network bandwidth, database resources, and take a long time to run. And your users won't actually look at more than a tiny fraction of these millions of records. Are you sure this is what you want?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Loren points out, if your intent on "not going back to the database" is to improve performance, you are barking up the wrong tree.
 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, as has been pointed out, millions of records will be quite overwhelming to a user, as a user is likely to access only a small fraction. Serve them up a menu, presenting the data in logical units. For instance, if you have millions of items in an inventory, break the set down logically (e.g. cosmetics, sporting goods, etc). This way, a user can retrieve a manageable set of data at any given time.

Sure, each time the user desires to access a new logical unit, you need to fire off a request to the database, but I believe this strategy is a bit more elegant that taking the entire cake and eating it in one mouthful.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic