posted 21 years ago
For non-scrollable, Oracle will fetch into memory the number of records specified in the fetch size parameter. Once you need more records, the old records are discarded and the number of new records specified by the fetch size are loaded into memory. In general, A higher fetch size means more memory usage, but less calls to the database and vice versa. So at any time, with the ResultSet open or closed, the maximum number of records in memory is the number specified in the fetch size.
BEWARE!! Scrollable resultsets work a little differently. They generally work the same as non-scrollable except when you need more records, the old records are NOT discarded and the number of new records specified by the fetch size are loaded into memory. So at any time, with the ResultSet open, the maximum number of records in memory is the number of records you have iterated through rounded up to a multiple of the fetch size.
Not exactly sure what happens on Oracle, but I'm pretty sure they just have pointers ( in the general sense ) to the matched rows, the current one being the cursor.
Jamie
[ November 29, 2002: Message edited by: Jamie Robertson ]