Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Pagination to fetch batch of records

User_19BPUJul 24 2015 — edited Jul 28 2015

Hi,

I am looking for a pagination to setup in our application which fetches 100 records per page click,  please let me know how I can proceed with it :-

I want to build a pagination by fetching the records in small batches in java using JDBC with Oracle 11g DB , I am using the below query :-

Select * from (Select * from <tablename> where <condition> order by id) where rownum > ? and rownum < ?

Please let me know how can get the values in small batches in java? I have set the batchsize as 100. Hence it will fetch 1 - 100 records, how I can get the next set of records like 101-200, 201-300, 301-400, etc. How I can write the incremental logic in java to get the next set of batches? Please provide some examples on this which will be of great help.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2015
Added on Jul 24 2015
7 comments
4,267 views