public abstract void cancel () throws SQLException

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.

Exceptions:
SQLException    if a database access error occurs or this method is called on a closed Statement
SQLFeatureNotSupportedException    if the JDBC driver does not support this method