jdbc Statement batching

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Statement batching is either executing multiple statements as one unit (with a normal java.sql.Statement), or a single statement with multiple sets of parameter values (with a java.sql.PreparedStatement).

Remarks

Statement batching allows a program to collect related statement, or in the case of prepared statements related parameter value sets, and send them to the database server as a single execute.

The benefits of statement batching can include improved performance. If and how these performance benefits are achieved depends on the driver and database support, but they include:

  • Sending all statements (or all values sets) in one command
  • Rewriting the statement(s) so they can be executed like one big statement


Got any jdbc Question?