--- title: "executeBatch Method (SQLServerStatement) | 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: - "SQLServerStatement.executeBatch" apilocation: - "sqljdbc.jar" apitype: "Assembly" ms.assetid: fb034f63-2532-4da8-a1b0-bc125734585a author: David-Engel ms.author: v-daenge --- # executeBatch Method (SQLServerStatement) [!INCLUDE[Driver_JDBC_Download](../../../includes/driver_jdbc_download.md)] Submits a batch of commands to the database to be run. If all commands run successfully, returns an array of update counts. ## Syntax ``` public int[] executeBatch() ``` ## Return Value An array of **int**s that contain the update counts. ## Exceptions [SQLServerException](../../../connect/jdbc/reference/sqlserverexception-class.md) java.sql.BatchUpdateException ## Remarks This executeBatch method is specified by the executeBatch method in the java.sql.Statement interface. After submitting commands to the database, this method clears any command in the batch. ## See Also [SQLServerStatement Members](../../../connect/jdbc/reference/sqlserverstatement-members.md) [SQLServerStatement Class](../../../connect/jdbc/reference/sqlserverstatement-class.md)