public class DataTruncation extends SQLWarning implements Serializable
SQLState error code for truncated data
is 01004.| Constructor and Description |
|---|
DataTruncation(int index,
boolean parameter,
boolean read,
int dataSize,
int transferSize)
Creates the
DataTruncation object. |
DataTruncation(int index,
boolean parameter,
boolean read,
int dataSize,
int transferSize,
Throwable cause)
Creates a DataTruncation.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDataSize()
Gets the number of bytes of data that should have been read/written.
|
int |
getIndex()
Gets the index of the column or of the parameter that was truncated.
|
boolean |
getParameter()
Gets whether the value truncated was a parameter value or a column value.
|
boolean |
getRead()
Gets whether the value was truncated on a read operation or a write
operation
|
int |
getTransferSize()
Gets the number of bytes of data that was actually read or written.
|
getNextWarning, setNextWarninggetErrorCode, 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 DataTruncation(int index,
boolean parameter,
boolean read,
int dataSize,
int transferSize)
DataTruncation object. The reason is set to "Data truncation", the error code is set to the SQLException default value, and the other fields are set to the values
supplied as arguments.index - the Index value of the column value or parameter that was
truncated.parameter - true if it was a parameter value that was truncated,
false otherwise.read - true if the truncation occurred on a read operation,
false otherwise.dataSize - the original size of the truncated data.transferSize - the size of the data after truncation.public DataTruncation(int index,
boolean parameter,
boolean read,
int dataSize,
int transferSize,
Throwable cause)
index - the Index value of the column value or parameter that was
truncatedparameter - true if it was a Parameter value that was truncated, false
otherwiseread - true if the truncation occurred on a read operation, false
otherwisedataSize - the original size of the truncated datatransferSize - the size of the data after truncationcause - the root reason for this DataTruncationpublic int getDataSize()
-1 if the size is unknown.public int getIndex()
public boolean getParameter()
true if the value truncated was a parameter value,
false if it was a column value.public boolean getRead()
true if the value was truncated on a read operation,
false otherwise.public int getTransferSize()
-1 if the size is unknown.