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:   <mailto:[EMAIL PROTECTED]>
    For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
    
    

Reply via email to