public class DataTruncation extends SQLWarning
DataTruncation
例外(写)或报告为
DataTruncation
警告(在读)当一个数据值竟是截断超过
MaxFieldSize
以外的原因。
在读一DataTruncation
SQLSTATE是01004
。
SQLSTATE一DataTruncation
期间写的是22001
。
Constructor and Description |
---|
DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize)
创建一个对象初始化
DataTruncation SQLSTATE 01004当
read 设置为22001时
true
read 设置
false ,设置为“数据截断的原因”,设置为0的供应商代码,并设置为给定值的其他领域。
|
DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize, Throwable cause)
创建一个对象初始化
DataTruncation SQLSTATE 01004当
read 设置为22001时
true
read 设置
false ,设置为“数据截断的原因”,设置为0的供应商代码,并设置为给定值的其他领域。
|
Modifier and Type | Method and Description |
---|---|
int |
getDataSize()
获取应该已传输的数据的字节数。
|
int |
getIndex()
检索被截断的列或参数的索引。
|
boolean |
getParameter()
指示值截断的值是否为参数值或列值。
|
boolean |
getRead()
指示是否被读取的值被截断。
|
int |
getTransferSize()
获取实际传输的数据的字节数。
|
getNextWarning, setNextWarning
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 DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize)
DataTruncation
SQLSTATE 01004当
read
设置为22001时
true
read
设置
false
,设置为“数据截断的原因”,设置为0的供应商代码,并设置为给定值的其他领域。的
cause
没有初始化,并随后可被调用的方法的
Throwable.initCause(java.lang.Throwable)
初始化。
index
-参数或列值的索引
parameter
-如果参数值被截断
read
-如果读被截断
dataSize
-原始的数据大小
transferSize
-尺寸截断后
public DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize, Throwable cause)
DataTruncation
SQLSTATE 01004当
read
设置为22001时
true
read
设置
false
,设置为“数据截断的原因”,设置为0的供应商代码,并设置为给定值的其他领域。
index
-参数或列值的索引
parameter
-如果参数值被截断
read
-如果读被截断
dataSize
-原始的数据大小
transferSize
-尺寸截断后
cause
-这
DataTruncation
的根本原因(这是以后的
getCause()
方法检索);可能是null指示的原因是不存在的或未知的。
public int getIndex()
这可能是1如果列或参数是未知的,在这种情况下,parameter
和read
字段应该被忽略。
public boolean getParameter()
true
如果值截断参数;
false
如果列值
public boolean getRead()
true
如果值被截断时,从数据库中读取;
false
如果数据被截断在写
public int getDataSize()
-1
如果大小是未知的。
public int getTransferSize()
-1
如果大小是未知的。
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.