I may be wrong, don't think your code really reads all the results at once. Not if you use JDBC, anyway. When you get a ResultSet back from a query, you have only the "next" nethod to advance to the next result. You have to do this repeatedly until you have got enough (or all) results. The ResultSet is free to trickle the results back if it wants to, each call to "next" will just block if the results are back from the database yet. Whether this actually happens or not, is up to whoever implemented your database and database driver.