<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.sql.DataTruncation
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.sql.html">This Package</a>  <a href="Package-java.sql.html">Previous</a>  <a href="java.sql.SQLException.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.sql.DataTruncation
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.lang.Throwable.html#_top_">java.lang.Throwable</a>
           |
           +----<a href="java.lang.Exception.html#_top_">java.lang.Exception</a>
                   |
                   +----<a href="java.sql.SQLException.html#_top_">java.sql.SQLException</a>
                           |
                           +----<a href="java.sql.SQLWarning.html#_top_">java.sql.SQLWarning</a>
                                   |
                                   +----java.sql.DataTruncation
</pre>
<hr>
<dl>
  <dt> public class <b>DataTruncation</b>
  <dt> extends <a href="java.sql.SQLWarning.html#_top_">SQLWarning</a>
</dl>
<P>When JDBC unexpectedly truncates a data value, it reports a
 DataTruncation warning (on reads) or throws a DataTruncation exception
 (on writes).
 <P>The SQLstate for a DataTruncation is "01004".
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#DataTruncation(int, boolean, boolean, int, int)"><b>DataTruncation</b></a>(int, boolean, boolean, int, int)
  <dd>  <P>Create a DataTruncation object.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDataSize()"><b>getDataSize</b></a>()
  <dd>  Get the number of bytes of data that should have been transferred.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getIndex()"><b>getIndex</b></a>()
  <dd>  Get the index of the column or parameter that was truncated.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getParameter()"><b>getParameter</b></a>()
  <dd>  Is this a truncated parameter value?

 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRead()"><b>getRead</b></a>()
  <dd>  Was this a read truncation?

 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getTransferSize()"><b>getTransferSize</b></a>()
  <dd>  Get the number of bytes of data actually transferred.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="DataTruncation"></a>
<a name="DataTruncation(int, boolean, boolean, int, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>DataTruncation</b>
<pre>
 public DataTruncation(int index,
                       boolean parameter,
                       boolean read,
                       int dataSize,
                       int transferSize)
</pre>
<dl>
  <dd> <P>Create a DataTruncation object. The SQLState is initialized
 to 01004, the reason is set to "Data truncation" and the
 vendorCode is set to the SQLException default.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> index - The index of the parameter or column value
    <dd> parameter - true if a parameter value was truncated
    <dd> read - true if a read was truncated
    <dd> dataSize - the original size of the data
    <dd> transferSize - the size after truncation
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getIndex()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getIndex"><b>getIndex</b></a>
<pre>
 public int getIndex()
</pre>
<dl>
  <dd> Get the index of the column or parameter that was truncated.
 <P>This may be -1 if the column or parameter index is unknown, in 
 which case the "parameter" and "read" fields should be ignored.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the index of the truncated paramter or column value.
  </dl></dd>
</dl>
<a name="getParameter()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getParameter"><b>getParameter</b></a>
<pre>
 public boolean getParameter()
</pre>
<dl>
  <dd> Is this a truncated parameter value?
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> True if the value was a parameter; false if it was a column value.
  </dl></dd>
</dl>
<a name="getRead()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRead"><b>getRead</b></a>
<pre>
 public boolean getRead()
</pre>
<dl>
  <dd> Was this a read truncation?
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> True if the value was truncated when read from the database; false
 if the data was truncated on a write.
  </dl></dd>
</dl>
<a name="getDataSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDataSize"><b>getDataSize</b></a>
<pre>
 public int getDataSize()
</pre>
<dl>
  <dd> 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.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of bytes of data that should have been transferred
  </dl></dd>
</dl>
<a name="getTransferSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getTransferSize"><b>getTransferSize</b></a>
<pre>
 public int getTransferSize()
</pre>
<dl>
  <dd> Get the number of bytes of data actually transferred.
 The value may be "-1" if the size is unknown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the number of bytes of data actually transferred
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.sql.html">This Package</a>  <a href="Package-java.sql.html">Previous</a>  <a href="java.sql.SQLException.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
