DataTruncationpublic class DataTruncation extends SQLWarning implements SerializableAn exception which is thrown when a JDBC driver unexpectedly truncates a data
value either when reading (resulting in warning), or when writing data
(resulting in an error). The {@code SQLState} error code for truncated data
is {@code 01004}. |
Fields Summary |
---|
private static final long | serialVersionUID | private int | index | private boolean | parameter | private boolean | read | private int | dataSize | private int | transferSize | private static final String | THE_REASON | private static final String | THE_SQLSTATE | private static final int | THE_ERROR_CODE |
Constructors Summary |
---|
public DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize)Creates the {@code DataTruncation} object. The reason is set to {@code
"Data truncation"}, the {@code ErrorCode} is set to the {@code
SQLException} default value, and the other fields are set to the values
supplied as arguments.
super(THE_REASON, THE_SQLSTATE, THE_ERROR_CODE);
this.index = index;
this.parameter = parameter;
this.read = read;
this.dataSize = dataSize;
this.transferSize = transferSize;
|
Methods Summary |
---|
public int | getDataSize()Gets the number of bytes of data that should have been read/written.
return dataSize;
| public int | getIndex()Gets the index of the column or of the parameter that was truncated.
return index;
| public boolean | getParameter()Gets whether the value truncated was a parameter value or a column value.
return parameter;
| public boolean | getRead()Gets whether the value was truncated on a read operation or a write
operation
return read;
| public int | getTransferSize()Gets the number of bytes of data that was actually read or written.
return transferSize;
|
|