Hey but i want to use more than one preparedStatement object using batch update
Printable View
Hey but i want to use more than one preparedStatement object using batch update
Hi,
Iam not getting you.
1.For a single PreparedStatement object u can pass single query using that you can insert/update multiple values as a batch(i.e) single transaction.For each and every value passing you have to call "addbatch().Finally you have to call executeBatch().So,entire batch will be executed in a single transaction.
One PreparedStatement object contains only one query.
2.Again if you want to have differenent query you need to create another PreparedStatement object and do the same process what I mentioned in the above step.
-Regards
Ramya
Yes, it's possible. It's better to look at this example.
Use Batch Multiple Updates with PreparedStatement : Batch Update*«*Database*«*Java Tutorial
Hi Swathi,
Already we have discussed regarding this with example.I don't know why you are getting doubts.Please go thru this thread for recalling what we did and send the piece of code what u have tried now.
http://www.java-forums.org/database/...t-queries.html
-Regards
Ramya
Is more than one preparedStatement object using batch update right one??