getFetchSize
public int getFetchSize()
throws SQLException
Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object. If this Statement object has not set a fetch size by calling the method setFetchSize, the return value is implementation-specific. Returns:
the default fetch size for result sets generated from this Statement object
Throws:
SQLException - if a database access error occurs
Since:
1.2
See Also:
setFetchSize(int)
public int getFetchSize()
throws SQLException
Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object. If this Statement object has not set a fetch size by calling the method setFetchSize, the return value is implementation-specific. Returns:
the default fetch size for result sets generated from this Statement object
Throws:
SQLException - if a database access error occurs
Since:
1.2
See Also:
setFetchSize(int)
public void setFetchSize(int rows)
throws SQLException
Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed. The number of rows specified affects only result sets created using this statement. If the value specified is zero, then the hint is ignored. The default value is zero. Parameters:
rows - the number of rows to fetch
Throws:
SQLException - if a database access error occurs, or the condition 0 <= rows <= this.getMaxRows() is not satisfied.
Since:
1.2
See Also:
getFetchSize()
我每次用的时候getFecthSize()都返回1,不管sql语句返回的记录集的条数为几,这怎么解释阿,快急死我了!!!