My java web application is retrieving a large dataset from the DB (DB2) and displaying the records on a webpage. Since the number of records is very large , the page takes a little time to load (about 15 secs) To improve this , I want to implement pagination on the server side , ie fetch only 50 records at a time and show it on the page. Then when the user clicks on Next , the next 50 records are fetched and displayed.
I have already implemented this on the client side ie I am showing the data in chunks of 50 , but I am still fetching the entire data in one database call, due to which the page takes time to load.
How can I implement the pagination on the server side ie fetch only 50 records at a time ?
Thanks in advance.