In JDBC batch processing we can execute a batch (group) of sql statements, instead of a single sql statement. It makes the faster performance.
The java.sql.Statement and java.sql.PreparedStatement interfaces provide two methods for batch processing, such as addBatch() method and executeBatch() method.
|void addBatch(String query).||It adds query into batch.|
|int executeBatch().||It executes the batch of queries.|
Let's see a demo program for batch processing in jdbc.
If you see the table student, two records has been added.
first we will create a table student as : create table student(regdno varchar2(25), name char(45));