If you can't figure out what you need to do with that course of action...
If you are querying a database, you could use a LIMIT clause
You can use the LIMIT to select a range of data to be collected with your query ( at
least I think thats pretty standard SQL, not sure though). That way chunks of data
could be as big as you wanted them.
Something like "LIMIT 0, 24" would show the first 25 records, "LIMIT 25, 49" the next
25 and so on
You can figure out how many of these 25 record chunks you can traverse through by
counting the number of records in your table and dividing by 25
Then you could set up some kind of "Next> <Previous First Last" kinda system (while
keeping track of what "chunk" you are on.
Which is what ListChunk is probably doing from a brief glance, with stuff like
(guessing here, could be way off)
java.util.Collection getCollection() [the chunk of data]
int getCurrentCount() [the chunk pointer]
int getFirstElementIndex()
int getTotalCount() [the actual total number of records]
Or you could have searched on google for ListChunk and clicked on about the third link
and found stuff like this
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_11945119.html
> -----Original Message-----
> From: Conway. Fintan (IT Solutions) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 21, 2002 10:38 AM
> To: JDJList
> Cc: 'Lydia P'
> Subject: [jdjlist] RE: Performance Issues
>
>
> Hi Lydia,
>
> Unfortunately, I have not received any replies on this.
>
> As far as I understand the design pattern (Page-by-Page
> iterator)
> does not specify how to split up the data you receive from
> the database into
> ListChunks.
>
> Does anybody have any concrete strategies for this?
> (Whether used
> with the page-by-page iterator or not)
>
> Thanks for your help,
>
> Fintan
>
> PS I am using Oracle DB if DB-specific solution is required
>
> -----Original Message-----
> From: Lydia P [mailto:[EMAIL PROTECTED]]
> Sent: 20 November 2002 19:02
> To: [EMAIL PROTECTED]
> Subject: [jdjlist] RE: Performance Issues
>
>
> Hi there, did you ever get an answer to this question?
> I have the same question. I am having a really hard time
> finding a way
> to get 'chunks' at a time of my list to display - I saw the
> ListChunk as
> well but have no idea what to do with it (can you tell im
> pretty new at
> this?)
> I have a DAO, VO/TO, ServiceLocator and an Action class and I
> have a jsp
> that uses struts/tiles and actually does return a very long list of
> data, so I really do need to break it up into pages.
>
> Any help you can give me would be greatly appreciated!
> Thanks,
> Lydia P
>
>
>
> > Can anybody explain how the Page-by-Page iterator works.
> >
> > I am not using EJB's and the Sun PetStore example boils
> down a ListChunk
> > class. This class retrieves the data from the database in
> Chunks, but how
> > this is done is not explained anywhere that I can find.
> >
> > Can anyone enlighten me on this issue?
> >
> > Many thanks,
> >
> > Fintan
>
>
>
> * ** *** ** * ** *** ** * ** *** ** *
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed.
> Any views or opinions presented are solely those of the
> author, and do not necessarily
> represent those of ESB.
> If you have received this email in error please notify the sender.
>
> Although ESB scans e-mail and attachments for viruses, it
> does not guarantee
> that either are virus-free and accepts no liability for any
> damage sustained
> as a result of viruses.
>
> * ** *** ** * ** *** ** * ** *** ** *
>
> ____________________________________________________
> To change your JDJList options, please visit:
> http://www.sys-con.com/java/list.cfm
>
> Be respectful! Clean up your posts before replying
> ____________________________________________________
>
____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________