Here you can find the source of createLargeResultSetStatement(Connection conn)
public static Statement createLargeResultSetStatement(Connection conn) throws SQLException
//package com.java2s; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { /**//w w w.jav a 2 s . c o m * Returns a new statement on the specified connection with the necessary options * to avoid running out of memory when reading a large result set. */ public static Statement createLargeResultSetStatement(Connection conn) throws SQLException { Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); stmt.setFetchSize(Integer.MIN_VALUE); return stmt; } }