java.lang.Object | |||||
↳ | java.lang.Throwable | ||||
↳ | java.lang.Exception | ||||
↳ | java.sql.SQLException | ||||
↳ | java.sql.SQLWarning | ||||
↳ | java.sql.DataTruncation |
An 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 SQLState
error code for truncated data
is 01004
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates the
DataTruncation object.
| |||||||||||
Creates a DataTruncation.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the number of bytes of data that should have been read/written.
| |||||||||||
Gets the index of the column or of the parameter that was truncated.
| |||||||||||
Gets whether the value truncated was a parameter value or a column value.
| |||||||||||
Gets whether the value was truncated on a read operation or a write
operation
| |||||||||||
Gets the number of bytes of data that was actually read or written.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.sql.SQLWarning
| |||||||||||
From class
java.sql.SQLException
| |||||||||||
From class
java.lang.Throwable
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Iterable
|
Creates the 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. |
Creates a DataTruncation. The Reason is set to "Data truncation", the error code is set to the SQLException default value and other fields are set to the values supplied on this method.
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 |
cause | the root reason for this DataTruncation |
Gets the number of bytes of data that should have been read/written.
-1
if the size is unknown.
Gets the index of the column or of the parameter that was truncated.
Gets whether the value truncated was a parameter value or a column value.
true
if the value truncated was a parameter value,
false
if it was a column value.
Gets whether the value was truncated on a read operation or a write operation
true
if the value was truncated on a read operation,
false
otherwise.
Gets the number of bytes of data that was actually read or written.
-1
if the size is unknown.