Class Overview
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.
Summary
| Public Constructors |
|
|
DataTruncation(int index, boolean parameter, boolean read, int dataSize, int transferSize)
Creates a DataTruncation.
|
| Public Methods |
|
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
|
|
[Expand]
Inherited Methods |
From class java.sql.SQLWarning
|
From class java.sql.SQLException
|
From class java.lang.Throwable
|
From class java.lang.Object
|
Object
|
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
|
|
boolean
|
equals(Object o)
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
|
|
void
|
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver.
|
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of java.lang.Class which represents the class
of the receiver.
|
|
int
|
hashCode()
Returns an integer hash code for the receiver.
|
|
final
void
|
notify()
Causes one thread which is wait ing on the receiver to be
made ready to run.
|
|
final
void
|
notifyAll()
Causes all threads which are wait ing on the receiver to
be made ready to run.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
|
final
void
|
wait(long time, int frac)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait(long time)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait()
Causes the thread which sent this message to be made not ready to run
pending some change in the receiver (as indicated by notify
or notifyAll).
|
|
Public Constructors
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
|
Public Methods
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.
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.
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
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.
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.