Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executeUpdate() Problem???

 
Arun Selvam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John Carnell
Author
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic