/**
Cancels this <code>Statement</code> object if both the DBMS and
driver support aborting an SQL statement.
This method can be used by one thread to cancel a statement that
is being executed by another thread.
@exception SQLException if a database access error occurs or
this method is called on a closed <code>Statement</code>
@exception SQLFeatureNotSupportedException if the JDBC driver does not support
this method
*/
void cancel() throws SQLException;
According to the javadoc description, if both the DBMS and the driver support it, you can use this API to end it You can set the timeout first:
Post the documentation for Statement.cancel():
According to the javadoc description, if both the DBMS and the driver support it, you can use this API to end it
You can set the timeout first:
Catch this exception and cancel()
mysql timeout setting