setQueryTimeout(int seconds)

Syntax:

void setQueryTimeout(int seconds)
                     throws SQLException

Description:

Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds. If the limit is exceeded, an SQLException is thrown. A JDBC driver must apply this limit to the execute, executeQuery and executeUpdate methods.

Parameters:

seconds - the new query timeout limit in seconds; zero means there is no limit

Throws:

SQLException - if a database access error occurs or the statement has been closed

Reference:

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