setMaxRows(int max)

Syntax:

void setMaxRows(int max)
                throws SQLException

Description:

Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number. If the limit is exceeded, the excess rows are silently dropped.

Parameters:

max

the new max rows limit; zero means there is no limit

Throws:

SQLException - if a database access error occurs, if max is less than 0, or the statement has been closed.

Reference:

For more information, reference JDBC documentation for: Statement.setMaxRows(int)