What are batch updates. in jdbc

Answer Posted / vijayakumar chinnasamy

Batch Update provide the functionality of executing a group
of sql statement at single timing.

Steps:

1.set autocommit as false for connection .
connectionObject.setAutoCommit(false);
2.create sql statement and add to statement object.
statementObj.addBatch("sql1");
statementObj.addBatch("sql2");
statementObj.addBatch("sql3");
3.execute the batch of statement using executeBatch().
statementObj.executebatch();
4. commit the connection.
connectionObj.commit();

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain implementation and how is it different from conversion?

583


Explain the difference between static and dynamic binding in java?

536


What is difference between overloading and overriding in java?

524


What do you mean by compiler?

578


Why java doesn’t support multiple inheritances?

578






Is char a data type in java?

537


Can you sort a string in java?

482


What is null mean in java?

617


How do you decide when to use arraylist and linkedlist?

528


What is a layout manager and what are different types of layout managers available in java awt?

718


Can we override singleton class?

528


What are the 5 types of research methods?

583


What does || || mean in math?

509


How do you identify if jvm is 32-bit or 64-bit from java program?

534


What is instance means in java?

559