| Author |
Batch Execution in JDBC
|
Shrinivas Mujumdar
Ranch Hand
Joined: Aug 27, 2004
Posts: 328
|
|
Hello Everybody, How to use different PreparedStatements in a single batch? e.g. if i have a 1st prepared statemnt like insert into emp values(?,?,?,?) & second one: delete from emp where empid=? then how these statements could be added in a single batch & executed? i hope the question is clear. Shrinivas Mujumdar
|
 |
Maximilian Xavier Stocker
Ranch Hand
Joined: Sep 20, 2005
Posts: 381
|
|
You can't do that (have different prepared statements in one batch). When you batch prepared statements it is the same statement each time only the parameters for the statement are batched.
|
 |
Shrinivas Mujumdar
Ranch Hand
Joined: Aug 27, 2004
Posts: 328
|
|
Hi, That means it is the limitation of Batch Execution in JDBC & such issues can only be handled using Stored Procedures. Any other solution than that.? Shrinivas
|
 |
Annie Smith
Ranch Hand
Joined: Mar 05, 2005
Posts: 172
|
|
A stored procedure is usually a good choice if there are lesser calls to the procedure and much processing which could be handled on the DB end. I am not sure if your case would exactly suit that. But I guess it would give you some (minor IMO) improvement in the performance.
|
Cheers!<br /><b>Annie</b>
|
 |
Shrinivas Mujumdar
Ranch Hand
Joined: Aug 27, 2004
Posts: 328
|
|
Thanks a Lot!!!
|
 |
 |
|
|
subject: Batch Execution in JDBC
|
|
|