addBatch
addBatch is a method in the JDBC API used to accumulate SQL commands for batch execution. It is provided by the java.sql.Statement and java.sql.PreparedStatement interfaces. With Statement, each call to addBatch adds a complete SQL command to the current batch; with PreparedStatement, you bind parameters for the current statement and call addBatch to add that parameterized instance to the batch.
Execution is triggered by executeBatch(), which sends all batched statements to the database in a single round
Best practices: use addBatch when performing many similar INSERT/UPDATE/DELETE operations to reduce round trips. Keep batch
Notes: not all statements or databases support batching; check driver documentation. Batch updates can improve throughput