cf API JDBC
The following two hints give the driver suggestions for improving performance:
1. The number of rows that should be fetched from the database each time new rows are needed
The number of rows to be fetched is called the fetch size, and it can be set by two different methods: Statement.setFetchSize and ResultSet.setFetchSize. The statement that creates a ResultSet object sets the default fetch size for that ResultSet object, using the Statement method setFetchSize. The following
code fragment sets the fetch size for the ResultSet object rs to 25. Until the fetch size is changed, any result set created by the Statement object stmt will automatically have a fetch size of 25.
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(SELECT * FROM EMPLOYEES);