executeUpdate 方法 (java.lang.String, java.lang.String)executeUpdate Method (java.lang.String, java.lang.String)

下载下载 JDBC 驱动程序DownloadDownload JDBC Driver

运行给定的 SQL 语句并向 Microsoft JDBC Driver for SQL ServerMicrosoft JDBC Driver for SQL Server 发出信号,指示给定数组中指示的自动生成的键应对检索可用。Runs the given SQL statement and signals Microsoft JDBC Driver for SQL ServerMicrosoft JDBC Driver for SQL Server that the auto-generated keys indicated in the given array should be made available for retrieval.


public final int executeUpdate(java.lang.String sql,  
                               java.lang.String[] columnNames)  



包含 SQL 语句的 String。A String that contains an SQL statement.


一个 String 类型的数组,指示哪些自动生成的键的列名应可用。An array of type String that indicates which column names of the auto-generated keys should be made available.

返回值Return Value

指示受影响行数的 int,如果使用 DDL 语句,则此值为 0。An int that indicates the number of rows affected, 0 if using a DDL statement.




此 executeUpdate 方法是由 java.sql.Statement 接口中的 executeUpdate 方法指定的。This executeUpdate method is specified by the executeUpdate method in the java.sql.Statement interface.

如果执行存储过程将产生大于 1 的更新计数,或生成多个结果集,则请使用 execute 方法执行存储过程。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 方法 (SQLServerStatement) executeUpdate Method (SQLServerStatement)
SQLServerStatement 成员 SQLServerStatement Members
SQLServerStatement 类SQLServerStatement Class