You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "CRANFORD, CHRIS" <Ch...@setechusa.com> on 2005/02/28 16:54:04 UTC

Queries and Paging

How have others implemented database queries and paging techniques in your struts applications?  I'd like to see how others have implemented such functionality to see if I can improve upon our current framework.

_______________________________________________________
Chris Cranford
Programmer/Developer
SETECH Inc. & Companies
6302 Fairview Rd, Suite 201, Charlotte, NC  28210
Phone: (704) 362-9423, Fax: (704) 362-9409, Mobile: (704) 650-1042 
Email: chris.cranford@setechusa.com


Re: Queries and Paging

Posted by Tim Christopher <ti...@gmail.com>.
If the only purpose of using paging is to display some nice table to
the user then the DisplayTag can sort that out for you, though its
more efficient to do as suggested and get a PaginatedList from the db.

For an example of the DisplayTag in action take a look here: 
http://displaytag.homeip.net/example-paging.jsp

The table in the above example is created with just 6 lines of code! 
I must admit I only downloaded it yesterday but IMO it's very easy to
use and my best discovery since Log4j!

Tim Christopher

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


Re: Queries and Paging

Posted by Lee Harrington <le...@gmail.com>.
Since I use hibernate with my struts, in my service class I added the following:

query.setFirstResult(pageStart);
query.setMaxResults(pageSize);

works great for paging through the records.

Lee

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


Re: Queries and Paging

Posted by Larry Meadors <la...@gmail.com>.
If you are looking for high-performance, use a stored procedure.

There are other techniques, but I'd bet lunch that none will come
close in terms of performance.

Larry


On Mon, 28 Feb 2005 09:54:04 -0600, CRANFORD, CHRIS
<Ch...@setechusa.com> wrote:
> How have others implemented database queries and paging techniques in your struts applications?  I'd like to see how others have implemented such functionality to see if I can improve upon our current framework.
> 
> _______________________________________________________
> Chris Cranford
> Programmer/Developer
> SETECH Inc. & Companies
> 6302 Fairview Rd, Suite 201, Charlotte, NC  28210
> Phone: (704) 362-9423, Fax: (704) 362-9409, Mobile: (704) 650-1042
> Email: chris.cranford@setechusa.com
> 
>

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