You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Manisha Sathe <ma...@yahoo.com> on 2005/01/18 09:24:46 UTC

How to limit the result?

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?

Re: How to limit the result?

Posted by Neil <ni...@gmail.com>.
yes, if you use <logic:iterate>


On Tue, 18 Jan 2005 00:24:46 -0800 (PST), Manisha Sathe
<ma...@yahoo.com> 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?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to limit the result?

Posted by Pavel Kolesnikov <pa...@gmail.com>.
On Tue, 18 Jan 2005 01:34:02 -0800 (PST), Manisha Sathe
<ma...@yahoo.com> wrote:
> After long search i found out that MSSQL does not support Limit / range of records to be fetched.

what about "set rowcount" or "select top"?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


OT Re: AW: How to limit the result?

Posted by Vic <vi...@friendvu.com>.
Yes, JSTL is doing Data in View.
Action is doing Data in Controller.

Data ... is done in data layer, depending on your DAO.
Again http://ibatis.com/common/example.html - if you look at bottom of 
page about pageNext.

Hopefully no one is writing to JDBC anymore, but using a DAO impl. That 
be like writing to Servlet and not using Struts.

You can limit the # of rows that come back in Transact SQL, pgSQL or 
plSQL. Tell me what Transact SQL mail list you are on (usenet?) and I 
will answer it there.

.V

JDBC/DAO questions are OT for Struts. Soon... hopefully view questions 
will be, so you can go to Tagblibs list or what view you use for that.


Leon Rosenberg wrote:

>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:junk1@bolsover.com]
>>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:manisha_msathe@yahoo.com]
>>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 <ma...@yahoo.com> 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: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>    
>>


-- 
RiA-SoA w/JDNC <http://www.SandraSF.com> forums
- help develop a community
My blog <http://www.sandrasf.com/adminBlog>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


AW: How to limit the result?

Posted by Leon Rosenberg <st...@anotheria.net>.
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:junk1@bolsover.com]
> 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:manisha_msathe@yahoo.com]
> 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 <ma...@yahoo.com> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How to limit the result?

Posted by David Bolsover <ju...@bolsover.com>.
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:manisha_msathe@yahoo.com]
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 <ma...@yahoo.com> 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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to limit the result?

Posted by Manisha Sathe <ma...@yahoo.com>.
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 <ma...@yahoo.com> 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!