File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes how to obtain a resultset having fixed records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "how to obtain a resultset having fixed records" Watch "how to obtain a resultset having fixed records" New topic

how to obtain a resultset having fixed records

smitha rai
Ranch Hand

Joined: Aug 15, 2001
Posts: 33
I want to query the database and get the resultset for the first 10 records OR next 10 records OR any recordsbased on row number. I used rownum in my select query, but it works for only first record. Apprecite if some one could help me out.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Please change your display name immediately since accounts with invalid display names get deleted. 14 posts is too many
Tanel Alumae

Joined: Aug 26, 2002
Posts: 14
If I understand correctly, what you want to do is called resultset paging.
You can find much information on this topic in this thread
An exhaustive review of the topic with implementation is given in this article at
[ September 09, 2002: Message edited by: Tanel Alumae ]

RefactorIT - Java Refactoring Tool<br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: how to obtain a resultset having fixed records
It's not a secret anymore!