8.5.71 setFetchSize(int rows)
- Organization of this subsection
(1) Function
This method specifies the fetch size (number of rows to be fetched) when the ResultSet object is retrieved.
(2) Format
public synchronized void setFetchSize(int rows) throws SQLException
(3) Arguments
- int rows
-
Specifies the number of rows to be fetched, in the range from 0 to 65,535.
If 0 is specified, retrieval is performed based on the value of adb_clt_fetch_size in the system properties, user properties, or URL connection properties.
If this method is omitted, the JDBC driver uses the number of rows specified in the Statement object for retrieval. If no number of rows is specified in the Statement object, or this ResultSet object has not been created from a Statement object, the JDBC driver uses the value of the adb_clt_fetch_size property for retrieval.
(4) Return value
None.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
This ResultSet object is closed.
This includes the case where the ResultSet object was closed because the Statement object that created this ResultSet object was closed.
-
The Connection used to create the Statement object that created this ResultSet object has been closed.
-
The ResultSet object has become invalid due to transaction settlement.
-
A value outside the range from 0 to 65,535 was specified in rows.
-
The value specified in rows is greater than the maximum number of rows that can be stored (the value set by the setMaxRows method of the Statement object that created this ResultSet object).
-
The value specified in rows is greater than the number of rows that can be stored (the value set by the setMaxLargeRows method of the Statement object that created this ResultSet object).
(6) Notes
For notes, see (6) Notes in 8.3.37 setFetchSize(int rows).