The moose likes JDBC 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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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 http://www.javaranch.com/name.jsp.
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 serverside.com
[ September 09, 2002: Message edited by: Tanel Alumae ]

RefactorIT - Java Refactoring Tool<br /><a href="http://www.refactorit.com" target="_blank" rel="nofollow">www.refactorit.com</a>
It is sorta covered in the JavaRanch Style Guide.
subject: how to obtain a resultset having fixed records
Similar Threads
Fetch only 'n' records from the ResultSet
regarding MS access sql query
hi all problem in resultset
how to handle Search results?