A) ->java.sql.statement and java.sql.prepared statement interfaces have methods to support batch processing. 1) addbatch (Strinf dml) : This method used to add an SQL statement to the batch. 2) int [ ] executebatch() : this method is used to submit the group of (batch of) SQL statements at a time to the DBMS.
A) ->Batch updates is a formality given by JDBC using which, DML SQL statement can be grouped physically into one unit and at a time submitted to the DBMS for processing as a batch. ->Batch updates mechanism improves performance some times by reducing the number of client/server interaction. ->we have 2 kinds of business Systems. 1) OLTPS (Online Transaction Processing Systems) 2) Batch processing System. To support batch processing systems, batch updates is given in JDBC. ->In case of OLTP, end user waits the system responds after giving input into the system. ->in case of batch processing system, end user doesn’t wait for the systems responds. ATM application is an example for OLTP. ->At the end of every month, all accounts must be created by their earned interest is an example use case of batch processing.