What are batch updates. in jdbc
Answers were Sorted based on User's Feedback
Answer / gajendra
Batch updates is a facility given by the JDBC to the
application developers to submit a set of SQL update
statements as batch to the database.
st.addBatch("Update statement1");
st.addBatch("Update statement2");
st.addBatch("Update statement3");
int updated[]=st.executeBatch();// This methods throws
BatchUpdateException and SQLException
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
How do you create a reference in java?
What is floor math?
Write java program to reverse string without using api?
Is empty list java?
How Marker Interfaces are instruct to complete the desired need ?
Where we write javascript code in html page?
Can a final variable be null?
Why Java is not purely object oriented?
50 Answers Elitecore, Persistent, Reliance, Wipro,
What is a wrapper method?
wht is customised exception?
1 Answers Logica CMG, Novell, Prudential,
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What is foreach loop in java?