Skip to Main Content

Java Database Connectivity (JDBC)

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!

JDBC Pagination

843859May 5 2010 — edited Nov 20 2014
Hi,
I want to implement pagination using jdbc. The actual thing i want to know is 'How can i get first 50 and then next 50 records from database for page 1 and 2 respectively'

My Query is "Select * from data" [data table contains 20,000 rows]

For page#1 i get 50 records and for page#2 i want to get next 50 records. How can i implement it efficiently in jdbc.

I have searched and found that "rs.absolute(row)" is the way to skip first page records but it takes some amount of time on large result sets and i don't want to bear this amount of time also i dont want to use 'rownum' and 'Limit + offset' in query because these are not good to use in query, i dont know why, still i dont want to use it in query.


Can anyone help me how to get limited resultset for pagination or is there any way JDBC is giving us ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2010
Added on May 5 2010
10 comments
1,416 views