Instead of executing a single query, we can execute a batch (group) of queries. It makes the performance fast. The java.sql.Statement and java.sql.PreparedStatement interfaces provide methods for batch processing.
The required methods for batch processing are given below:
void addBatch(String query)
It adds query into batch.
It executes the batch of queries.
Let's see the simple example of batch processing in jdbc. It follows following steps:
A11 Acharya Niketan
Mayur Vihar 1
Near MayurVihar Metro Station