/** Cancels this Statement 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 Statement @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