Class java.sql.DataTruncation
All Packages Class Hierarchy This Package Previous Next Index
Class java.sql.DataTruncation
java.lang.Object
|
+----java.lang.Throwable
|
+----java.lang.Exception
|
+----java.sql.SQLException
|
+----java.sql.SQLWarning
|
+----java.sql.DataTruncation
- public class DataTruncation
- extends SQLWarning
When JDBC unexpectedly truncates a data value it reports a
DataTruncation warning (on reads) or throws a DataTruncation exception
(on writes).
The SQLstate for a DataTruncation is set to "01004".
-
DataTruncation(int, boolean, boolean, int, int)
-
-
getDataSize()
- Get the number of bytes of data that should have been transferred.
-
getIndex()
- Get the index of the column or parameter that was truncated.
-
getParameter()
- True if the value was a parameter; false if it was a column value.
-
getRead()
- True if the value was truncated when read from the database; false
if the data was truncated on a write.
-
getTransferSize()
- Get the number of bytes of data actually transferred.
DataTruncation
public DataTruncation(int index,
boolean parameter,
boolean read,
int dataSize,
int transferSize)
getIndex
public int getIndex()
- Get 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 "parameter" and "read" fields should be ignored.
- Returns:
- the DataTruncation's index value
getParameter
public boolean getParameter()
- True if the value was a parameter; false if it was a column value.
- Returns:
- the DataTruncation's parameter value
getRead
public boolean getRead()
- True if the value was truncated when read from the database; false
if the data was truncated on a write.
- Returns:
- the DataTruncation's read value
getDataSize
public int getDataSize()
- Get 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 "-1" if the size is unknown.
- Returns:
- the DataTruncation's dataSize value
getTransferSize
public int getTransferSize()
- Get the number of bytes of data actually transferred.
The value may be "-1" if the size is unknown.
- Returns:
- the DataTruncation's transferSize value
All Packages Class Hierarchy This Package Previous Next Index