46. What do you mean by batch update

  1. The JDBC drivers that support JDBC 2.0 and above support batch updates.
  2. With batch updates, instead of updating rows of a  table one at a time, you can direct JDBC to execute a group of updates at the same time.
  3. Statements that can be included in the same batch of updates are known as batchable statements.

Homogeneous batch: If a statement has input parameters or host expressions, you can include that statement only in a batch that has other instances of the same statement. This type of batch is known as a homogeneous batch.

Heterogeneous batch: If a statement has no input parameters, you can include that statement in a batch only if the other statements in the batch have no input parameters or host expressions. This type of batch is known as a heterogeneous batch.

Two statements that can be included in the same batch are known as batch compatible.

Use the following Statement methods for creating, executing, and removing a batch of SQL updates:

  • addBatch
  • executeBatch
  • clearBatch

example: the amendments to the all email ids of the employees.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: