Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.sql

Class DataTruncation

java.lang.Object
|
+--java.lang.Throwable
   |
   +--java.lang.Exception
      |
      +--java.sql.SQLException
         |
         +--java.sql.SQLWarning
            |
            +--java.sql.DataTruncation


public class DataTruncation

extends SQLWarning

This exception is thrown when a piece of data is unexpectedly truncated in JDBC.

Author:

Constructor Summary

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

This method initializes a new instance of DataTruncation with the specified values.

Method Summary

intgetDataSize()

This method returns the original size of the parameter or column that was truncated.
intgetIndex()

This method returns the index of the column or parameter that was truncated.
booleangetParameter()

This method determines whether or not it was a parameter that was truncated.
booleangetRead()

This method determines whether or not it was a column that was truncated.
intgetTransferSize()

This method returns the size of the parameter or column after it was truncated.

Constructor Details

DataTruncation

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

This method initializes a new instance of DataTruncation with the specified values. The descriptive error message for this exception will be "Data truncation", the SQL state will be "01004" and the vendor specific error code will be set to 0.

Parameters:


Method Details

getDataSize

public int getDataSize()

This method returns the original size of the parameter or column that was truncated.

Returns:


getIndex

public int getIndex()

This method returns the index of the column or parameter that was truncated.

Returns:


getParameter

public boolean getParameter()

This method determines whether or not it was a parameter that was truncated.

Returns:


getRead

public boolean getRead()

This method determines whether or not it was a column that was truncated.

Returns:


getTransferSize

public int getTransferSize()

This method returns the size of the parameter or column after it was truncated.

Returns: