Or, if you don't like having your Persistence layer depend on a JSP
view being around, you might consider automating
instantiation/population of beans within whatever your query subsystem
is.  This way you can populate just as many beans as you intend to use
and save some overhead.

It really depends upon your DB platform.  Some RDBMS engines provide
ways to facilitate paging; others do not.  Some let you get the first
so many in a result, and that's handy for the FIRST page of results,
but what about page 2, 3, ..., n.  This is why I've opted for
iterating through and populating only what I want.  I'm able to use
absolute() to get to where I want to start and then iterate over the
result until I've either gotten all I want or run out of result set.

Good Luck

Eddie

On Tue, 18 Jan 2005 11:29:09 -0000, David Bolsover <[EMAIL PROTECTED]> wrote:
> 
> OK .. My suggestion for a look at javax.servlet.jsp.jstl.sql.ResultImpl and
> associated classes did not suggest the use of jstl tags - although probably
> more convenient.  If you take the trouble to look at these classes, you will
> find that they can assist in restricting the data returned from the
> ResultSet - It was this issue I was addressing.
> 
> javax.servlet.jsp.jstl.sql.Result is an implementation of SortedMap - as
> such it should be possible to use <logic:iterate> - although personaly, I
> prefer the use of jstl core:forEach in this case.
> 
> db
> 
> -----Original Message-----
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
> Sent: 18 January 2005 10:55
> To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> Subject: AW: How to limit the result?
> 
> Despite the honourable wish to help,
> 
> How does an advice to use jstl-sql tags relates to a struts-user list?
> 
> To the original question:
> Why don't you put exactly the same amount of databeans in your arraylist as
> you want to show? And where do you do it? Exact, in your action.
> 
> Alternatively you could use one of many paging taglibs out there (check
> sourceforge).
> 
> > -----Ursprüngliche Nachricht-----
> > Von: David Bolsover [mailto:[EMAIL PROTECTED]
> > Gesendet: Dienstag, 18. Januar 2005 11:47
> > An: Struts Users Mailing List
> > Betreff: RE: How to limit the result?
> >
> >
> > Processing ResultSets into custom beans can be a frustrating process..
> >
> > You should have look at javax.servlet.jsp.jstl.sql.ResultImpl and
> > associated
> > classes.
> >
> > You will find in the jstl source distribution.
> >
> > Essentially, with a little effort, these classes will process a ResultSet
> > and return a javax.servlet.jsp.jstl.sql.Result object. The Result object
> > is
> > easily itterated over in your JSP
> >
> > db
> >
> >
> >
> > -----Original Message-----
> > From: Manisha Sathe [mailto:[EMAIL PROTECTED]
> > Sent: 18 January 2005 09:34
> > To: Struts Users Mailing List
> > Subject: Re: How to limit the result?
> >
> >
> > After long search i found out that MSSQL does not support Limit / range of
> > records to be fetched.
> >
> > Now i am thinking ->
> > 1)putting each row into one databean.
> > 2)Put databean into ArrayList
> > 3)send this arraylist back to JSP
> >
> > with jstl tags i can loop through it and display. <c:foreach>...<c:out>
> >
> > But how i can decide it has reached page limit ? because at that point of
> > time i want to display my footer (and header for new set).
> >
> > Is there any way to set some variable and keep on incrementing it .. check
> > for pagesize and then include header/footer etc...
> >
> > Is there any better solution ? Am i going a long way ?
> >
> > regards
> > Manisha
> >
> >
> >
> >
> >
> > Manisha Sathe <[EMAIL PROTECTED]> wrote:
> > I have a query which results into large data. This data i want to display
> > in
> > a group of 20. After every 20 records i want to add header and footer to
> > it.
> >
> > Is it possible to get the result set data into batch of 20 ? means can i
> > specify start and end index of query ?
> >
> > regards
> > Manisha
> >
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > The all-new My Yahoo!  What will yours do?
> >
> > ---------------------------------
> > Do you Yahoo!?
> >  The all-new My Yahoo!  Get yours free!
> > =======================================================
> > This message has been scanned for viruses and dangerous
> > content using Vet Anti-Virus Protection and is believed
> > to be clean.
> > =======================================================
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> =======================================================
> This message has been scanned for viruses and dangerous
> content using Vet Anti-Virus Protection and is believed
> to be clean.
> =======================================================
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Eddie Bush

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to