How to do pagination which reduce our server load ?

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

  • RajdeepCE
    RajdeepCE
    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

You are reading an archived discussion.

Related Posts

I would like to know whether it is possible to increase output from existing thermal power plant either in terms of heat input,efficiency, vacuum , heat rate , exhaust parameters...
What are the problems in pumping wet steam say at 0.2 kg/ sq. cm to boiler pressure? I think that instead of extracting steam to vacuum pressure( negative pressure to...
This is the scenario is most of the IT outsourced jobs. Since the'giver' of work is sitting in some part of the world , the 'doer' is in another part...
sir, i am working for baja atv in india we'll be having an interview soon in 5 days and we have only one factor which could help ur to get...
Since last week, Our website SuntekStore.com has been under DDOS (Distributed Denial Of Service)attack by someone who goes by the name of Ivan Alekseevich Ivanov from Khabarovsk, Russia and he...