Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2 KB

File metadata and controls

61 lines (47 loc) · 2 KB
title executeQuery Method (SQLServerStatement) | Microsoft Docs
ms.custom
ms.date 01/19/2017
ms.prod sql
ms.prod_service drivers
ms.service
ms.component jdbc
ms.reviewer
ms.suite sql
ms.technology
drivers
ms.tgt_pltfrm
ms.topic article
apiname
SQLServerStatement.executeQuery
apilocation
sqljdbc.jar
apitype Assembly
ms.assetid 599cf463-e19f-4baa-bacb-513cad7c6cd8
caps.latest.revision 13
author MightyPen
ms.author genemi
manager jhubbard
ms.workload Inactive

executeQuery Method (SQLServerStatement)

[!INCLUDEDriver_JDBC_Download]

Runs the given SQL statement and returns a single SQLServerResultSet object.

Syntax

  
public java.sql.ResultSet executeQuery(java.lang.String sql)  

Parameters

sql

A String that contains an SQL statement.

Return Value

A SQLServerResultSet object.

Exceptions

SQLServerException

Remarks

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

SQLServerException is thrown if the given SQL statement produces anything other than a single SQLServerResultSet object.

If executing a stored procedure results in an update count that is greater than one, or that generates more than one result set, use the execute method to execute the stored procedure.

See Also

SQLServerStatement Members
SQLServerStatement Class