8.3.3 cancel()
- Organization of this subsection
(1) Function
This method cancels the SQL statements executing in the corresponding object and in objects using the same connection as that object.
You can use this method to cancel executing SQL statements asynchronously.
(2) Format
public void cancel() throws SQLException
(3) Arguments
None.
(4) Return value
None.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The Statement object is closed.
-
The Connection object that created the Statement object is closed.
(6) Notes
-
If the corresponding Statement object is not executing any SQL statements, but another object is executing SQL statements on the same connection object, this method performs asynchronous cancellation.
-
If the corresponding Statement object is not executing any SQL statements and no other object is executing SQL statements on the same connection object, this method does not perform cancellation processing.
-
If asynchronous cancellation of SQL statements is successful, the transaction is rolled back.