Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 2.2 KB

File metadata and controls

56 lines (41 loc) · 2.2 KB
title executeQuery Method (java.lang.String) | 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
SQLServerPreparedStatement.executeQuery (java.lang.String)
apilocation
sqljdbc.jar
apitype Assembly
ms.assetid 610205c2-6bcd-426c-ad6f-9682551efdec
author David-Engel
ms.author v-daenge

executeQuery Method (java.lang.String)

[!INCLUDEDriver_JDBC_Download]

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

Syntax

  
public final 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.

This method overrides the executeQuery method that is found in the SQLServerStatement class.

Calling this method will result in an exception since the SQL statement for the SQLServerPreparedStatement object is specified when the object is created.

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

See Also

executeQuery Method (SQLServerPreparedStatement)
SQLServerPreparedStatement Members
SQLServerPreparedStatement Class