How to execute bulk number of queries at once?

Answer Posted / kalyan

we can update multiple statements using batch as follows

statemenent st = getconnection().getStatement();
st.addBatch(sql stat1);
st.addBatch(sql stat2) ;

....

st.executeBatch();

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is 2 phase commit?

565


What are the classes and methods used for sending sql statements to database?

543


What are database warnings in jdbc and how can we handle database warnings in jdbc?

613


What is the difference between executing, executequery, executeupdate in jdbc?

564


How to set NULL values in JDBC PreparedStatement?

545






What are the jdbc drivers in java?

525


How many types of jdbc drivers are available?

497


What types of DataSource objects are specified in the Optional Package?

509


What are the jdbc api components?

657


What is meant by connection string?

558


Differentiate between stored procedure and functions?

622


Which database is used for java?

530


Explain jdbc savepoint?

567


What does jdbc stand for?

509


Explain the locking system in jdbc?

547