Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 2.28 KB

File metadata and controls

45 lines (34 loc) · 2.28 KB
title close Method (SQLServerResultSet) | Microsoft Docs
ms.custom
ms.date 01/19/2017
ms.prod sql
ms.prod_service connectivity
ms.reviewer
ms.technology connectivity
ms.topic conceptual
apiname
SQLServerResultSet.close
apilocation
sqljdbc.jar
apitype Assembly
ms.assetid 8f3adf5b-874e-4cf2-b4ef-672dda42d77a
author David-Engel
ms.author v-daenge

close Method (SQLServerResultSet)

[!INCLUDEDriver_JDBC_Download]

Releases this SQLServerResultSet object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed.

Syntax

  
public void close()  

Exceptions

SQLServerException

Remarks

This close method is specified by the close method in the java.sql.ResultSet interface.

A SQLServerResultSet object is automatically closed by the SQLServerStatement object that generated it when that SQLServerStatement object is closed, re-run, or used to retrieve the next result from a sequence of multiple results. A SQLServerResultSet object is also automatically closed when it is garbage collected.

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

SQLServerResultSet Members
SQLServerResultSet Class