File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes executeUpdate() Problem??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "executeUpdate() Problem???" Watch "executeUpdate() Problem???" New topic
Author

executeUpdate() Problem???

Arun Selvam
Greenhorn

Joined: Oct 08, 2002
Posts: 1
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

Joined: Sep 27, 2002
Posts: 71
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 />john.carnell@netchange.us<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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executeUpdate() Problem???
 
Similar Threads
Issue with BatchExection of CallableStatement with StoredProcedures in DB2
executeBatch
problems with batch update
JDBC addBatch problem
executeBatch() failing for 100 and above