How to handle pagination when there are records like say in millions in java? Or do we handle this using SQL? I as asked this question in an interview.
Its better to handle at SQL end. Just fetch the records you need and then display in Java. Database server will give you far good performance then Java pagination.