Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.76 KB

cancel-method-sqlserverstatement.md

File metadata and controls

38 lines (28 loc) · 1.76 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic apilocation apiname apitype
cancel Method (SQLServerStatement)
cancel Method (SQLServerStatement)
David-Engel
v-davidengel
01/19/2017
sql
connectivity
reference
sqljdbc.jar
SQLServerStatement.cancel
Assembly

cancel Method (SQLServerStatement)

[!INCLUDEDriver_JDBC_Download]

Cancels the SQL statement that is currently being run by this SQLServerStatement object.

Syntax

  
public final void cancel()  

Exceptions

SQLServerException

Remarks

This cancel method is specified by the cancel method in the java.sql.Statement interface.

When executing a statement that produces a single large forward-only, read-only result set, you might only be interested in some initial set of rows in the returned result set. In this case, the application might call the cancel method of the associated statement object before closing the result set in order to minimize the processing time needed to discard the remaining unnecessary rows. We recommend considering the tradeoff between the processing time that would be saved and the time and the additional round trip to the server needed to cancel the execution when deciding whether to use this technique or not.

See Also

SQLServerStatement Members
SQLServerStatement Class