Hi All, I am trying to bulk insert rows from one table to another, using addBatch()/executeBatch(). Though it works fine, If any one insert statement in executeBatch() fails, then it stops proceeding. Is there any way, just discard the fails and proceed executeBatch() till the end? I am using Microsoft JDBC 2.0 Driver in WebLogic 6.1 SP3 any help will be really useful, thanks, Arun
posted 14 years ago
Hi Arun, Its going to depend on how your JDBC driver vendor handles errors in batch updates. It sounds like your driver does not allow the batch updates to continue if there is an error with one of the calls. A driver can throw the BatchUpdateException when an error occurs while processing a batch. If the driver does continue with processing the batch commands, the array returned by the executeBatch() call will contain a -3 for each batch command that blew up. Hope that helps. (You might want to check the Sun Java API docs for a full description of the executeBatch call). Thanks, John
John Carnell<br />Principal Architect<br /> <br />Netchange, LLC<br />1161 HillCrest Heights<br />Green Bay, WI 54313<br /> <br />firstname.lastname@example.org<br /> <br /> <br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/159059228X/ref=jranch-20" target="_blank" rel="nofollow">Pro Jakarta Struts, Second Edition</a>
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads