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

Can a final method be overloaded?

510


How do you find the independent variable?

519


How do you declare a destructor in java?

506


What is console based application in java?

544


What is the finalize method do?

599






What does int [] mean in java?

536


Can you access the private method from outside the class?

508


How do generics work in java?

522


Can an interface be defined inside a class?

520


What is array class in java?

596


What is a ?

755


What are the Class Libraries ?

599


What is the difference between a method and a function in alice?

576


Why we override equals() method?

567


Explain the use of shift operator in java. Can you give some examples?

543