CrazyEngineers
  • Hello friends
    I want to do pagination using java.
    There are two ways comes in my mind to do pagination.
    1.Fetch whole data at once and display it page by page.
    2.Fire the query when people hit for the new page.

    I think in 1st case server load is more while in other case it's not.But i don't have any idea how to implement this.
    Suppose i have 100's of record's are stored in my database.I want to fetch 2nd 10 data after clicking on the 2nd page and 3rd 10 data on the click of 3rd page.So anybody know the sql query to do so ?

    Please suggest some tld file which can help in doing this work.
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • RajdeepCE

    MemberAug 12, 2011

    Which Database are you using?
    If you using any other than MS-SQL than following query works fine on MySQL,

    SELECT * FROM table LIMIT 10,20

    & if you are using MS-SQL than you need to do some programming like below,

    SELECT * FROM (
    SELECT *, ROW_NUMBER() OVER (ORDER BY TABLE_COLO) as row FROM table
    ) a WHERE row > 5 and row <= 10
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register