public class BatchUpdateException extends SQLException
SQLException扔在批处理更新操作期间发生错误时,子类的。除了
SQLException提供的信息,一个
BatchUpdateException提供所有命令均成功的批量更新,这是在执行更新计数,所有的命令都是在执行发生错误。更新计数数组中元素的顺序对应于将命令添加到批处理中的顺序。
在批处理更新命令未正确执行和BatchUpdateException抛出,司机可能会或可能不会继续在批处理剩余的命令。如果司机继续处理失败之后,返回的数组的方法BatchUpdateException.getUpdateCounts将每一条命令在批而不是命令成功执行之前错误只有元素。在司机继续处理命令的情况下,任何命令失败的数组元素Statement.EXECUTE_FAILED。
JDBC驱动程序的实现应该使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 代替构造函数,以避免int[]为更新计数溢出的可能性。
如果Statement.executeLargeBatch方法时建议getLargeUpdateCounts被代替getUpdateCounts为了避免整数更新计数可能溢出。
| Constructor and Description |
|---|
BatchUpdateException()
构建了一个
BatchUpdateException对象。
|
BatchUpdateException(int[] updateCounts)
构建了一个
BatchUpdateException对象与一个给定的
updateCounts初始化。
|
BatchUpdateException(int[] updateCounts, Throwable cause)
构建了一个
BatchUpdateException对象与一个给定的
cause和
updateCounts初始化。
|
BatchUpdateException(String reason, int[] updateCounts)
构建了一个
BatchUpdateException对象与一个给定的
reason和
updateCounts初始化。
|
BatchUpdateException(String reason, int[] updateCounts, Throwable cause)
构建了一个
BatchUpdateException对象初始化一个给定的
reason,
cause和
updateCounts。
|
BatchUpdateException(String reason, String SQLState, int[] updateCounts)
构建了一个
BatchUpdateException对象初始化一个给定的
reason,
SQLState和
updateCounts。
|
BatchUpdateException(String reason, String SQLState, int[] updateCounts, Throwable cause)
构建了一个
BatchUpdateException对象与一个给定的
reason,
SQLState,
cause初始化,和
updateCounts。
|
BatchUpdateException(String reason, String SQLState, int vendorCode, int[] updateCounts)
构建了一个
BatchUpdateException对象与一个给定的
reason,
SQLState初始化,
vendorCode和
updateCounts。
|
BatchUpdateException(String reason, String SQLState, int vendorCode, int[] updateCounts, Throwable cause)
构建了一个
BatchUpdateException对象与一个给定的
reason,
SQLState初始化,
vendorCode
cause和
updateCounts。
|
BatchUpdateException(String reason, String SQLState, int vendorCode, long[] updateCounts, Throwable cause)
构建了一个
BatchUpdateException对象与一个给定的
reason,
SQLState初始化,
vendorCode
cause和
updateCounts。
|
BatchUpdateException(Throwable cause)
构建了一个
BatchUpdateException对象与一个给定的
cause初始化。
|
| Modifier and Type | Method and Description |
|---|---|
long[] |
getLargeUpdateCounts()
在在此异常发生之前,在批更新中的每个更新语句中检索每个更新语句的更新计数。
|
int[] |
getUpdateCounts()
在在此异常发生之前,在批更新中的每个更新语句中检索每个更新语句的更新计数。
|
getErrorCode, getNextException, getSQLState, iterator, setNextExceptionaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic BatchUpdateException(String reason, String SQLState, int vendorCode, int[] updateCounts)
BatchUpdateException对象与一个给定的
reason,
SQLState初始化,
vendorCode和
updateCounts。的
cause没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)初始化。
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
reason -错误的描述
SQLState - XOPEN或SQL:2003码识别异常
vendorCode -由一个特定的数据库厂商使用的异常代码
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(String reason, String SQLState, int[] updateCounts)
BatchUpdateException对象初始化一个给定的
reason,
SQLState和
updateCounts。的
cause没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)初始化。供应商代码被初始化为0。
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
reason -描述的例外
SQLState - XOPEN或SQL:2003码识别异常
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(String reason, int[] updateCounts)
BatchUpdateException对象与一个给定的
reason和
updateCounts初始化。的
cause没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)初始化。的
SQLState初始化为
null和厂商代码初始化为0。
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
reason -描述的例外
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(int[] updateCounts)
BatchUpdateException对象与一个给定的
updateCounts初始化。被调用的方法的
Throwable.initCause(java.lang.Throwable)初始化。的
reason和
SQLState初始化为null和厂商代码初始化为0。
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException()
BatchUpdateException对象。的
reason,
SQLState和
updateCounts初始化为
null和厂商代码初始化为0。的
cause没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)初始化。
public BatchUpdateException(Throwable cause)
BatchUpdateException对象与一个给定的
cause初始化。的
SQLState和
updateCounts初始化为
null和厂商代码初始化为0。的
reason初始化为
null如果
cause==null或
cause.toString()如果
cause!=null。
cause -这
SQLException的根本原因(这是以后的
getCause()方法检索);可能是null指示的原因是不存在的或未知的。
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(int[] updateCounts,
Throwable cause)
BatchUpdateException对象与一个给定的
cause和
updateCounts初始化。的
SQLState初始化为
null和厂商代码初始化为0。的
reason初始化为
null如果
cause==null或
cause.toString()如果
cause!=null。
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
cause -这
SQLException的根本原因(这是以后的
getCause()方法检索);可能是null指示的原因是不存在的或未知的。
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(String reason, int[] updateCounts, Throwable cause)
BatchUpdateException对象初始化一个给定的
reason,
cause和
updateCounts。的
SQLState初始化为
null和厂商代码初始化为0。
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
reason -描述的例外
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
cause -这
SQLException的根本原因(这是以后的
getCause()方法检索);可能是null指示的原因是不存在的或未知的。
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(String reason, String SQLState, int[] updateCounts, Throwable cause)
BatchUpdateException对象与一个给定的
reason,
SQLState,
cause初始化,和
updateCounts。供应商代码被初始化为0。
reason -描述的例外
SQLState - XOPEN或SQL:2003码识别异常
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
cause -这
SQLException的根本原因(这是以后的
getCause()方法检索);可能是null指示的原因是不存在的或未知的。
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(String reason, String SQLState, int vendorCode, int[] updateCounts, Throwable cause)
BatchUpdateException对象与一个给定的
reason,
SQLState初始化,
vendorCode
cause和
updateCounts。
reason -错误的描述
SQLState - XOPEN或SQL:2003码识别异常
vendorCode -由一个特定的数据库厂商使用的异常代码
updateCounts -
int数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后
注:没有验证updateCounts溢出,因此建议使用构造函数BatchUpdateException(String reason, String SQLState, int vendorCode, long []updateCounts,Throwable cause) 。
cause -这
SQLException的根本原因(这是以后的
getCause()方法检索);可能是null指示的原因是不存在的或未知的。
BatchUpdateException(java.lang.String, java.lang.String, int, long[], java.lang.Throwable)
public BatchUpdateException(String reason, String SQLState, int vendorCode, long[] updateCounts, Throwable cause)
BatchUpdateException对象与一个给定的
reason,
SQLState初始化,
vendorCode
cause和
updateCounts。
此构造函数时应该使用返回更新计数可能超过Integer.MAX_VALUE。
reason -错误的描述
SQLState - XOPEN或SQL:2003码识别异常
vendorCode -由一个特定的数据库厂商使用的异常代码
updateCounts -
long数组,每个元素表示更新计数,
Statement.SUCCESS_NO_INFO或
Statement.EXECUTE_FAILED每个SQL命令在批处理JDBC驱动程序继续处理命令失败后;更新计数或
Statement.SUCCESS_NO_INFO在批每个SQL命令对JDBC驱动程序停止处理命令失败后失败之前
cause -这
SQLException的根本原因(这是以后的
getCause()方法检索);可能是null指示的原因是不存在的或未知的。
public int[] getUpdateCounts()
BatchUpdateException被更新计。
这种方法可能返回的值被修改为java 2 SDK,标准版、1.3版。这样做是为了适应后BatchUpdateException对象已经继续在批处理更新过程中命令的新选择。
int数组发生。或者,如果司机继续处理命令错误后,一批中的每个命令如下:
Statement.SUCCESS_NO_INFO表示命令执行成功但受影响的行数是未知的Statement.EXECUTE_FAILED表示命令执行失败的成功getLargeUpdateCounts()
public long[] getLargeUpdateCounts()
BatchUpdateException被更新计。
这一方法时应使用Statement.executeLargeBatch调用和返回更新计数可能超过Integer.MAX_VALUE。
long数组发生。或者,如果司机继续处理命令错误后,一批中的每个命令如下:
Statement.SUCCESS_NO_INFO表示命令执行成功但受影响的行数是未知的Statement.EXECUTE_FAILED表示命令执行失败的成功 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.