I see a lot of "best practices" guides for JDBC/MySQL that tells me to specify setFetchSize().
However, I have no idea when to specify, and what(statement, result set) to specify.
Statement.setFetchSize() or PreparedStatement.setFetchSize()
ResultSet.setFetchSize()
- Of these two, what should I specify?
- From javadoc and oracle documentation, this is where I get confused about "when"
Javadoc
The default value is set by the Statement object that created the result set. The fetch size may be changed at any time.
Oracle Doc
Changes made to the fetch size of a statement object after a result set is produced will have no affect on that result set.
Please correct me if I am wrong. Does this mean that setFetchSize is only Affective before a query is executed?(Therefore, setFetchSize on a ResultSet is useless? But happens to "The fetch size may be changed at any time"?)