Batch Execution on a Prepared Statement
- Last Updated: May 12, 2026
- 2 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
Batch execution on a prepared statement allows you to update or insert multiple records simultaneously. In some cases, this can significantly improve system performance because fewer round-trips to the database are required.
Note: Batch execution on a prepared statement is supported by the JDBC 2.0 and higher specifications and requires a Java 2 Platform (J2SE 1.4 or higher)-compatible Java Virtual Machine.
-
From the Connection window menu, select Connection / Create Prepared Statement.
-
Specify the Insert statement that you want to execute.

Click Submit; then, click Close.
-
Select Statement / Add Stmt Batch.
-
For each parameter:
a. Type the parameter number.
b. Select the parameter type.
c. Type the parameter value.
d. Click Set.
-
Click Add to add the specified set of parameters to the batch. To add multiple parameter sets to the batch, repeat Step 3 through Step 5 as many times as necessary. When you are finished adding parameter sets to the batch, click Close.
-
Select Statement / Execute Stmt Batch. DataDirect Test displays the rowcount for each of the elements in the batch.

-
If you re-execute the Select statement from Executing a Simple Select Statement, you see that the previously inserted records are returned.
.
