My understanding is that the
JDBC driver might base a ResultSet on a database cursor and only fetch a small number of rows. These rows are cached on the client side of the connection and, when exhausted, the next block of rows is retrieved by repositioning the cursor.
So, it may appear as if the ResultSet holds all the data, but this would be unlikely if a very large amount of data is involved.