1. preparedstatement PS = con. preparestatement ("select * From mytablename ",
Resultset. type_forward_only, resultset. concur_read_only );
2. // ps. setfetchsize (integer. min_value );
3. resultset rs = ps.exe cutequery ();
When the data volume of the mytablename table is large (3rd million records), rows throw a memory overflow exception.
Solution: Add row 2nd to solve the problem.
Note: lines 2nd cannot be written as PS. setfetchsize (1 );
4. preparedstatement PS2 = con. preparestatement ("select * From mytable2 ");
5. resultset rs2 = ps2.executequery ();
However, when the comments of the 2nd rows are removed, the 5th rows throw an exception. Because ps. setfetchsize (integer. min_value) is set,
Other resultset cannot be opened on con before RS is disabled.
Solution: if the previous result set must be in the open state, the result set to be opened later can be opened on another connection.