简体   繁体   中英

JDBC sql query (batch processing)

i want to make a batch update(100 resords) and batch insert(50 records) with jdbc in java using a single statement like i want to hit the database just once. How can i do that?

In java you have something called as prepared statement.In the prepared statement you have addBatch() and executeBatch() methods. These methods can be helpful in your case. Here is an example : http://viralpatel.net/blogs/batch-insert-in-java-jdbc/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM