Meaningless Drivel is fun!
The moose likes JSP and the fly likes Rendering Large resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Rendering Large resultset" Watch "Rendering Large resultset" New topic

Rendering Large resultset

A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
Hello Friends,

I need your help for the scenario i am explaining here.

I have search form, from here user will search for the records by giving search options which will featch the records from the database. I am using display tag library to display them as a table in jsp. I am using this because i need pagination and exporting fetaures.

I am buillidng the collection object from the result set and put that object in session which i feed to display tag to display them.

But here the problem is, for small and medium no of records it is ok, but if the records are million i am getting out of memory or heap size error.

so I need your help to overcome this problem. Please rember i need to let the user to export the records in csv and excel and need to do pagination as it is very hard to see all the millon records in single page.

Thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

See the JSP FAQ. It details the way to tell the database to only fetch the records needed for the current page. Fetching anything else is a waste of resources and needless.

[Asking smart questions] [About Bear] [Books by Bear]
A Babu
Ranch Hand

Joined: Nov 28, 2005
Posts: 114
can anyone help?
Aditya Keyal
Ranch Hand

Joined: Dec 01, 2008
Posts: 71
Just in case you could not understand what Bear wanted to indicate try this link. Pagination

As for you excel/csv, retrieve all the records and write them into a file instead of adopting the above process.

- Aditya Webservices Blog
I agree. Here's the link:
subject: Rendering Large resultset
It's not a secret anymore!