Build 1.0_r1(from source)

java.sql
Class DataTruncation

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.sql.SQLException
              extended by java.sql.SQLWarning
                  extended by java.sql.DataTruncation
All Implemented Interfaces:
Serializable

public class DataTruncation
extends SQLWarning
implements Serializable

An exception which is thrown when a JDBC driver unexpectedly truncates a data value either when reading or when writing data. The SQLState value for a DataTruncation is 01004.

See Also:
Serialized Form

Constructor Summary
DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize)
          Creates a DataTruncation.
 
Method Summary
 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
 
Methods inherited from class java.sql.SQLWarning
getNextWarning, setNextWarning
 
Methods inherited from class java.sql.SQLException
getErrorCode, getNextException, getSQLState, setNextException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTruncation

public DataTruncation(int index,
                      boolean parameter,
                      boolean read,
                      int dataSize,
                      int transferSize)
Creates a DataTruncation. The Reason is set to "Data truncation", the ErrorCode is set to the SQLException default value and other fields are set to the values supplied on this method.

Parameters:
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
Method Detail

getDataSize

public int getDataSize()
Gets the number of bytes of data that should have been read/written.

Returns:
the number of bytes that should have been read or written. The value may be set to -1 if the size is unknown.

getIndex

public int getIndex()
Gets the index of the column or of the parameter that was truncated.

Returns:
the index number of the column or of the parameter.

getParameter

public boolean getParameter()
Gets whether the value truncated was a parameter value or a column value.

Returns:
true if the value truncated was a Parameter value, false if it was a column value

getRead

public boolean getRead()
Gets whether the value was truncated on a read operation or a write operation

Returns:
true if the value was truncated on a read operation, false otherwise.

getTransferSize

public int getTransferSize()
Gets the number of bytes of data that was actually read or written

Returns:
the number of bytes actually read/written. The value may be set to -1 if the size is unknown.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature