This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Batch updates of preparedstatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Batch updates of preparedstatement" Watch "Batch updates of preparedstatement" New topic

Batch updates of preparedstatement

Alok Pota
Ranch Hand

Joined: Mar 07, 2001
Posts: 185
How do we use batch updates with PreparedStatements.. ? more specifically how do I bind variables t a bunch of preparedstatements added to a batch
is it something like this:-
Statement stmt = conn.createStatement();
stmt.addBatch("update test set id = ? where id = ?");
stmt.addBatch("delete from test1 where id = ?");
stmt.addBatch("insert into test values(?,?,?)");
Would the above work?
I agree. Here's the link:
subject: Batch updates of preparedstatement
It's not a secret anymore!