March 2012
Intermediate to advanced
442 pages
9h 31m
English
Instead of updating one row at a time, we can also update multiple rows simultaneously. We can create a batch from a set of statements and execute them at once. This is mainly done for better performance, as compared to updating a single row at a time. We can only create a batch for similar update statements (also known as batch-compatible statements). All statements must have similar types of input parameters. Either all statements should have input parameters or none of them should have input parameters.
A batch update can be done by using the following methods on the PreparedStatement object.
addBatch()executeBatch()clearBatch()A batch can be created for a Statement object or ...
Read now
Unlock full access