DataTruncation
exception
(on writes) or reported as a
DataTruncation
warning (on reads)
when a data values is unexpectedly truncated for reasons other than its having
exceeded MaxFieldSize
.
The SQLstate for a DataTruncation
during read is 01004
.
The SQLstate for a DataTruncation
during write is 22001
.
Modifier and Type | Field and Description |
---|---|
private int | |
private int | |
private boolean | |
private boolean | |
private static final long | |
private int |
Access | Constructor and Description |
---|---|
public | DataTruncation(int
The index of the parameter or column value index, boolean true if a parameter value was truncated parameter, boolean true if a read was truncated read, int the original size of the data dataSize, int the size after truncation transferSize)Creates a |
public | DataTruncation(int
The index of the parameter or column value index, boolean true if a parameter value was truncated parameter, boolean true if a read was truncated read, int the original size of the data dataSize, int the size after truncation transferSize, Throwable the underlying reason for this cause)DataTruncation
(which is saved for later retrieval by the getCause() method);
may be null indicating the cause is non-existent or unknown.Creates a |
Modifier and Type | Method and Description |
---|---|
public int | Returns: the number of bytes of data that should have been transferredGets the number of bytes of data that should have been transferred. |
public int | Returns: the index of the truncated parameter or column valueRetrieves the index of the column or parameter that was truncated. |
public boolean | Returns: true if the value truncated was a parameter;
false if it was a column valueIndicates whether the value truncated was a parameter value or a column value. |
public boolean | Returns: true if the value was truncated when read from
the database; false if the data was truncated on a writeIndicates whether or not the value was truncated on a read. |
public int | Returns: the number of bytes of data actually transferredGets the number of bytes of data actually transferred. |
dataSize | back to summary |
---|---|
private int dataSize |
index | back to summary |
---|---|
private int index |
parameter | back to summary |
---|---|
private boolean parameter |
read | back to summary |
---|---|
private boolean read |
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID |
transferSize | back to summary |
---|---|
private int transferSize |
DataTruncation | back to summary |
---|---|
public DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize) Creates a
|
DataTruncation | back to summary |
---|---|
public DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize, Throwable cause) Creates a
|
getDataSize | back to summary |
---|---|
public int getDataSize() Gets the number of bytes of data that should have been transferred.
This number may be approximate if data conversions were being
performed. The value may be
|
getIndex | back to summary |
---|---|
public int getIndex() Retrieves the index of the column or parameter that was truncated. This may be -1 if the column or parameter index is unknown, in
which case the
|
getParameter | back to summary |
---|---|
public boolean getParameter() Indicates whether the value truncated was a parameter value or a column value.
|
getRead | back to summary |
---|---|
public boolean getRead() Indicates whether or not the value was truncated on a read.
|
getTransferSize | back to summary |
---|---|
public int getTransferSize() Gets the number of bytes of data actually transferred.
The value may be
|