* If one of the commands in a batch update fails to execute properly,
* this method throws a <code>BatchUpdateException</code>, and a JDBC
* driver may or may not continue to process the remaining commands in
* the batch.
如果批量处理时其中一个命令执行失败,则会抛出一个异常BatchUpdateException
JDBC驱动可能会停止剩余的命令,也可能继续执行剩余的命令。
* However, the driver's behavior must be consistent with a
* particular DBMS, either always continuing to process commands or never
* continuing to process commands.
不管怎样,驱动要怎么做取决于数据库管理系统的细节,总是执行或总是不执行两者其一。
* If the driver continues processing
* after a failure, the array returned by the method
* <code>BatchUpdateException.getUpdateCounts</code>
* will contain as many elements as there are commands in the batch, and
* at least one of the elements will be the following:
发生失败后如果驱动继续执行,通过BatchUpdateException.getUpdateCounts()方法返回
的数组应该包括批处理中有的那些命令的结果,并且至少有一个元素的值是下面的情况:
* <P>
* <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed
* to execute successfully and occurs only if a driver continues to
* process commands after a command fails
int EXECUTE_FAILED = -3;
指示命令没有成功执行的常量值EXECUTE_FAILED,并且只有在命令出错后驱动继续执行的情况下才会出现,
如果出错后不再执行,则返回的结果中没有错误信息只有那些被成功执行后的结果。
* </OL>
* <P>
executeBatch方法详解2
最新推荐文章于 2022-06-27 18:08:30 发布