You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Field-Elliot <br...@netmeme.org> on 2002/03/06 05:18:03 UTC

Re: Are there any patters for pager design with EntityBeans providing access to the database?

The best approach is to use a database-specific extension (since paging
is not part of SQL standard syntax).

I use PostgreSQL which has very nice and easy paging support (using
LIMIT and OFFSET keywords).

I've tried to do it once before using Oracle but had some trouble (as I
recall the "rownum" didn't work as intuitively as you would hope or
expect).

The fallback position is to load the whole resultset into memory and
store it as a session variable. This is a bad practice if the resultset
can be large (a thousand rows or more for example).

Bryan

On Tue, 2002-03-05 at 21:12, Alex Paransky wrote:

    I was wondering how people are implementing paging capability in struts.  In
    other words, if the result set comes back with 2000 rows, how do you display
    page 4 of 100 with 20 results per page?
    
    Is writing custom SQL commands to depend on ROWNUM or something of that sort
    always required?  Are there any easy mechanism to do paging?  Would this be
    a good place to use a Statefull Session Bean and store it in to the session?
    
    Thanks.
    
    -AP_
    http://www.alexparansky.com
    
    
    --
    To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
    For additional commands, e-mail: <ma...@jakarta.apache.org>
    
    

Re: Are there any patters for pager design with EntityBeansproviding access to the database?

Posted by Barry Glasco <bg...@silverhosting.com>.
Fast Lane reader and page iterator pattern's using JDBC 2.0 and
a tag that you can find by searching the archives.


----- Original Message -----
From: "Bryan Field-Elliot" <br...@netmeme.org>
To: <ap...@standardset.com>
Cc: "'Struts Users'" <st...@jakarta.apache.org>
Sent: Tuesday, March 05, 2002 11:18 PM
Subject: Re: Are there any patters for pager design with
EntityBeansproviding access to the database?


> The best approach is to use a database-specific extension (since paging
> is not part of SQL standard syntax).
>
> I use PostgreSQL which has very nice and easy paging support (using
> LIMIT and OFFSET keywords).
>
> I've tried to do it once before using Oracle but had some trouble (as I
> recall the "rownum" didn't work as intuitively as you would hope or
> expect).
>
> The fallback position is to load the whole resultset into memory and
> store it as a session variable. This is a bad practice if the resultset
> can be large (a thousand rows or more for example).
>
> Bryan
>
> On Tue, 2002-03-05 at 21:12, Alex Paransky wrote:
>
>     I was wondering how people are implementing paging capability in
struts.  In
>     other words, if the result set comes back with 2000 rows, how do you
display
>     page 4 of 100 with 20 results per page?
>
>     Is writing custom SQL commands to depend on ROWNUM or something of
that sort
>     always required?  Are there any easy mechanism to do paging?  Would
this be
>     a good place to use a Statefull Session Bean and store it in to the
session?
>
>     Thanks.
>
>     -AP_
>     http://www.alexparansky.com
>
>
>     --
>     To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
>     For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>