Question - What is batch processing and how to do it in JDBC?
Answer -
Batch processing is the process of executing several SQL statements in one transaction. Doing so will reduce communication time and increase performance. It makes processing a large amount of data much easier.
Advantages of Batch Processing:
Improve performance
Data consistency
How to perform Batch Processing:
We have addBatch() and executeBatch() methods in Java to perform Batch processing. These 2 methods are present in Statement and PreparedStatement classes.