db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zithulele Basil Shange" <zithule...@cibecs.com>
Subject RE: Large Resultset
Date Wed, 01 Mar 2006 08:31:11 GMT
I am using the TableModel to buffer the results in memory for the Table or
passing it to Jasper report. The memory is consumed by the Report generation
as well as TableModel for rows about 10000 upwards.

Is there a way of traversing a resultset or DB on a per set of rows? If I
can keep the ResultSet and run through it on paging by the size that I want.
What is the cost of the ResultSet in memory?

-----Original Message-----
From: Stanley Bradbury [mailto:Stan.Bradbury@gmail.com] 
Sent: 28 February 2006 10:07 PM
To: Derby Discussion
Subject: Re: Large Resultset

Zithulele Basil Shange wrote:

> I have a DB (Derby) having 100's thousands of rows. I would like to 
> select row using a condition and be able to page them. The problem is 
> that if I page them in memory I get an outofmemory error or the rowset 
> returns a couple of thousands instead of all the rows matching the 
> condition.
> Is there a way of retrieving a large amount of data rows and be able 
> to page them as well?
> I have tried to limitting the results by setMaxRows but paging them is 
> a problem.
> Regards
> Zithulele

Hi -
I've not implemented a data paging system like yours but the answer to your
question  is yes,  Derby will allow you to retrieve large amounts of data in
a ResultSet.  Derby should handle the buffering of data between the database
and the application without exhausting memory. If the outofmemory error
happens in derby classes then you will need to increase the maxHeap
allocated to Java. 

As for paging the data this needs to be handled by the application and my
guess is this is where your problem lies.  How are you
constructing/buffering your pages before displaying them?  Is the
outofmemory error happening in these classes?

View raw message