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".


Constructor Index

 o DataTruncation(int, boolean, boolean, int, int)

Method Index

 o getDataSize()
Get the number of bytes of data that should have been transferred.
 o getIndex()
Get the index of the column or parameter that was truncated.
 o getParameter()
True if the value was a parameter; false if it was a column value.
 o getRead()
True if the value was truncated when read from the database; false if the data was truncated on a write.
 o getTransferSize()
Get the number of bytes of data actually transferred.

Constructors

 o DataTruncation
  public DataTruncation(int index,
                        boolean parameter,
                        boolean read,
                        int dataSize,
                        int transferSize)

Methods

 o 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
 o getParameter
  public boolean getParameter()
True if the value was a parameter; false if it was a column value.
Returns:
the DataTruncation's parameter value
 o 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
 o 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
 o 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