#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    9
    Rep Power
    0

    Displaying queries on multiple pages


    I'm trying to display the first 15 queries on one page, and allow the user to click on the next page to display the next 15 pages and so on. However, I'm using JSP/IBM DB2 and DB2 doesn't have the limit function so I'm not sure how to go about it, would appreciate any assistance.

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    Try using the following syntax:
    select *
    from table
    first x rows only
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    9
    Rep Power
    0
    Hi,
    yes I've used that select statement for my first page, but how am I gona know if there are other rows in the table so that I can put a "next page" ?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    You will need to obtain the count(*) from resultset and work through the records.
    Fifty records returned
    Page 1: Display 15
    Page 2: Display 15
    Page 3: Display 15
    Page 4: Display 5
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    9
    Rep Power
    0
    how do i go about getting the count ?
    I'm totally clueless if say i link it to nextPage.jsp then how do i set it such that they would display
    2 3 4 5 and so on ... ?

IMN logo majestic logo threadwatch logo seochat tools logo