Limiting the number of rows returned by SQL or ResultSet
843853Sep 17 2001 — edited Jan 13 2007Hello,
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!