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!

Limiting the number of rows returned by SQL or ResultSet

843853Sep 17 2001 — edited Jan 13 2007
Hello,

I'm trying to limit the number of rows that my application receives to a user-specified value. The user is asked how many accounts they want returned and I want to limit my ResultSet to this amount. I'd prefer to set up the SQL to do this if possible rather than waste time returning more records than necessary to the ResultSet.

If it's not possible to limit the SQL, how can I limit the number when processing the ResultSet?

Or, is there any way to setup a cursor in JDBC without being able to use Stored Procedures?

I'm going up against DB2 using DB2Connect.

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2007
Added on Sep 17 2001
20 comments
1,260 views