执行批量操作Performing batch operations
08/12/2019
本文内容
为了提高对 SQL ServerSQL Server 数据库进行多项更新时的性能,Microsoft JDBC Driver for SQL ServerMicrosoft JDBC Driver for SQL Server 提供了将多项更新作为一个工作单元提交的功能,也称作“批”。To improve performance when multiple updates to a SQL ServerSQL Server database are occurring, the Microsoft JDBC Driver for SQL ServerMicrosoft JDBC Driver for SQL Server provides the ability to submit multiple updates as a single unit of work, also referred to as a batch.
addBatch 方法可用于添加命令。The addBatch method is used to add a command. clearBatch 方法可用于清除命令列表。The clearBatch method is used to clear the list of commands. executeBatch 方法可用于提交要处理的所有命令。The executeBatch method is used to submit all commands for processing. 只有返回简单更新计数的数据定义语言 (Data Definition Language, DDL) 和数据操作语言 (Data Manipulation Language, DML) 语句可作为批处理的一部分运行。Only Data Definition Language (DDL) and Data Manipulation Language (DML) statements that re