Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 2.67 KB

managing-result-sets-with-the-jdbc-driver.md

File metadata and controls

35 lines (25 loc) · 2.67 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic
Managing result sets
Learn how to manage the results of a query by using result sets in the JDBC driver for SQL Server.
David-Engel
davidengel
08/12/2019
sql
connectivity
conceptual

Managing result sets with the JDBC driver

[!INCLUDEDriver_JDBC_Download]

The result set is an object that represents a set of data returned from a data source, usually as the result of a query. The result set contains rows and columns to hold the requested data elements, and it is navigated with a cursor. A result set can be updatable, meaning that it can be modified and have those modifications pushed to the original data source. A result set can also have various levels of sensitivity to changes in the underlying data source.

The type of result set is determined when a statement is created, which is when a call to the createStatement method of the SQLServerConnection class is made. The fundamental role of a result set is to provide Java applications with a usable representation of the database data. This task is typically done with the typed getter and setter methods on the result set data elements.

In the following example, which is based on the [!INCLUDEssSampleDBnormal] sample database, a result set is created by calling the executeQuery method of the SQLServerStatement class. Data from the result set is then displayed by using the getString method of the SQLServerResultSet class.

[!codeJDBC#ManagingResultSets1]

The articles in this section describe various aspects of result set usage, including cursor types, concurrency, and row locking.

In this section

Article Description
Understanding cursor types Describes the different cursor types that the [!INCLUDEjdbcNoVersion] supports.
Understanding concurrency control Describes how the JDBC driver supports concurrency control.
Understanding row locking Describes how the JDBC driver supports row locking.

See also

Overview of the JDBC driver