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, setNextException
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public 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.