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 |
What is a predicate method?
Can we define package statement after import statement in java?
What is initial size of arraylist in java?
How to reverse a string in java?
How do you use parseint in java?
How does predicate work in java?
What is an iterator interface in java programming?
what is the use of declaring constructor as private?
5 Answers Cyient, IVY Technologies, Sai Softech, Virtusa,
Can an abstract class have a constructor?
What are synchronized methods ?
Give an example of call be reference significance.
Define immutable object?