Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.98 KB

File metadata and controls

47 lines (34 loc) · 1.98 KB
title executeUpdate Method (java.lang.String) (SQLServerStatement)
description executeUpdate Method (java.lang.String) (SQLServerStatement)
author David-Engel
ms.author davidengel
ms.date 01/19/2017
ms.service sql
ms.subservice connectivity
ms.topic reference
apilocation sqljdbc.jar
apiname SQLServerStatement.executeUpdate (java.lang.String)
apitype Assembly

executeUpdate Method (java.lang.String) (SQLServerStatement)

[!INCLUDEDriver_JDBC_Download]

Runs the given SQL statement, which can be an INSERT, UPDATE, or DELETE statement; or a SQL statement that returns nothing, such as a SQL DDL statement. Beginning in [!INCLUDEmsCoName] [!INCLUDEssNoVersion] JDBC Driver 3.0, executeUpdate will return the correct number of rows updated in a MERGE operation.

Syntax

  
public int executeUpdate(java.lang.String sql)  

Parameters

sql

A String that contains the SQL statement.

Return Value

An int that indicates the number of rows affected, or 0 if using a DDL statement.

Exceptions

SQLServerException

Remarks

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

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

executeUpdate Method (SQLServerStatement)
SQLServerStatement Members
SQLServerStatement Class