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 to optimize the javac output?
Can set contain duplicates?
Differentiate between overriding and overloading cases?
What is run time allocation?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
What is array length?
How could Java classes direct program messages to the system console, but error messages, say to a file?
how to handle http request in struts
What is method Overloading in the perspective of OOPS?
What does exp mean in math?
How can an object be unreferenced?
Does java trim remove newline?