<!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>
  Interface java.sql.Statement
</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="java.sql.ResultSetMetaData.html#_top_">Previous</a>  <a href="Package-java.sql.html">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface java.sql.Statement
</h1>
<dl>
  <dt> public interface <b>Statement</b>
</dl>
<P>A Statement object is used for executing a static SQL statement
 and obtaining the results produced by it. 
 <P>Only one ResultSet per Statement can be open at any point in
 time. Therefore, if the reading of one ResultSet is interleaved
 with the reading of another, each must have been generated by
 different Statements. All statement execute methods implicitly
 close a statment's current ResultSet if an open one exists.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.sql.Connection.html#createStatement">createStatement</a>, <a href="java.sql.ResultSet.html#_top_">ResultSet</a>
</dl>
<hr>
<a name="index"></a>
<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="#cancel()"><b>cancel</b></a>()
  <dd>  Cancel can be used by one thread to cancel a statement that
 is being executed by another thread.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#clearWarnings()"><b>clearWarnings</b></a>()
  <dd>  After this call, getWarnings returns null until a new warning is
 reported for this Statement.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#close()"><b>close</b></a>()
  <dd>  In many cases, it is desirable to immediately release a
 Statements's database and JDBC resources instead of waiting for
 this to happen when it is automatically closed; the close
 method provides this immediate release.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#execute(java.lang.String)"><b>execute</b></a>(String)
  <dd>  Execute a SQL statement that may return multiple results.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#executeQuery(java.lang.String)"><b>executeQuery</b></a>(String)
  <dd>  Execute a SQL statement that returns a single ResultSet.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#executeUpdate(java.lang.String)"><b>executeUpdate</b></a>(String)
  <dd>  Execute a SQL INSERT, UPDATE or DELETE statement.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getMaxFieldSize()"><b>getMaxFieldSize</b></a>()
  <dd>  The maxFieldSize limit (in bytes) is the maximum amount of data
 returned for any column value; it only applies to BINARY,
 VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR
 columns.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getMaxRows()"><b>getMaxRows</b></a>()
  <dd>  The maxRows limit is the maximum number of rows that a
 ResultSet can contain.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getMoreResults()"><b>getMoreResults</b></a>()
  <dd>  getMoreResults moves to a Statement's next result.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getQueryTimeout()"><b>getQueryTimeout</b></a>()
  <dd>  The queryTimeout limit is the number of seconds the driver will
 wait for a Statement to execute.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getResultSet()"><b>getResultSet</b></a>()
  <dd>   getResultSet returns the current result as a ResultSet.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getUpdateCount()"><b>getUpdateCount</b></a>()
  <dd>   getUpdateCount returns the current result as an update count;
  if the result is a ResultSet or there are no more results, -1
  is returned.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getWarnings()"><b>getWarnings</b></a>()
  <dd>  The first warning reported by calls on this Statement is
 returned.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setCursorName(java.lang.String)"><b>setCursorName</b></a>(String)
  <dd>  setCursorname defines the SQL cursor name that will be used by
 subsequent Statement execute methods.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setEscapeProcessing(boolean)"><b>setEscapeProcessing</b></a>(boolean)
  <dd>  If escape scanning is on (the default), the driver will do
 escape substitution before sending the SQL to the database.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setMaxFieldSize(int)"><b>setMaxFieldSize</b></a>(int)
  <dd>  The maxFieldSize limit (in bytes) is set to limit the size of
 data that can be returned for any column value; it only applies
 to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and
 LONGVARCHAR fields.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setMaxRows(int)"><b>setMaxRows</b></a>(int)
  <dd>  The maxRows limit is set to limit the number of rows that any
 ResultSet can contain.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setQueryTimeout(int)"><b>setQueryTimeout</b></a>(int)
  <dd>  The queryTimeout limit is the number of seconds the driver will
 wait for a Statement to execute.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="executeQuery(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="executeQuery"><b>executeQuery</b></a>
<pre>
 public abstract <a href="java.sql.ResultSet.html#_top_">ResultSet</a> executeQuery(<a href="java.lang.String.html#_top_">String</a> sql) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Execute a SQL statement that returns a single ResultSet.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> sql - typically this is a static SQL SELECT statement
    <dt> <b>Returns:</b>
    <dd> a ResultSet that contains the data produced by the
 query; never null
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="executeUpdate(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="executeUpdate"><b>executeUpdate</b></a>
<pre>
 public abstract int executeUpdate(<a href="java.lang.String.html#_top_">String</a> sql) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Execute a SQL INSERT, UPDATE or DELETE statement. In addition,
 SQL statements that return nothing such as SQL DDL statements
 can be executed.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> sql - a SQL INSERT, UPDATE or DELETE statement or a SQL
 statement that returns nothing
    <dt> <b>Returns:</b>
    <dd> either the row count for INSERT, UPDATE or DELETE or 0
 for SQL statements that return nothing
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="close"><b>close</b></a>
<pre>
 public abstract void close() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> In many cases, it is desirable to immediately release a
 Statements's database and JDBC resources instead of waiting for
 this to happen when it is automatically closed; the close
 method provides this immediate release.
 <P><B>Note:</B> A Statement is automatically closed when it is
 garbage collected. When a Statement is closed, its current
 ResultSet, if one exists, is also closed.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getMaxFieldSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getMaxFieldSize"><b>getMaxFieldSize</b></a>
<pre>
 public abstract int getMaxFieldSize() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The maxFieldSize limit (in bytes) is the maximum amount of data
 returned for any column value; it only applies to BINARY,
 VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR
 columns.  If the limit is exceeded, the excess data is silently
 discarded.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the current max column size limit; zero means unlimited
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="setMaxFieldSize(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setMaxFieldSize"><b>setMaxFieldSize</b></a>
<pre>
 public abstract void setMaxFieldSize(int max) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The maxFieldSize limit (in bytes) is set to limit the size of
 data that can be returned for any column value; it only applies
 to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and
 LONGVARCHAR fields.  If the limit is exceeded, the excess data
 is silently discarded. For maximum portability use values
 greater than 256.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> max - the new max column size limit; zero means unlimited
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getMaxRows()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getMaxRows"><b>getMaxRows</b></a>
<pre>
 public abstract int getMaxRows() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The maxRows limit is the maximum number of rows that a
 ResultSet can contain.  If the limit is exceeded, the excess
 rows are silently dropped.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the current max row limit; zero means unlimited
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="setMaxRows(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setMaxRows"><b>setMaxRows</b></a>
<pre>
 public abstract void setMaxRows(int max) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The maxRows limit is set to limit the number of rows that any
 ResultSet can contain.  If the limit is exceeded, the excess
 rows are silently dropped.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> max - the new max rows limit; zero means unlimited
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="setEscapeProcessing(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setEscapeProcessing"><b>setEscapeProcessing</b></a>
<pre>
 public abstract void setEscapeProcessing(boolean enable) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> If escape scanning is on (the default), the driver will do
 escape substitution before sending the SQL to the database.
 Note: Since prepared statements have usually been parsed prior
 to making this call, disabling escape processing for prepared
 statements will like have no affect.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> enable - true to enable; false to disable
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getQueryTimeout()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getQueryTimeout"><b>getQueryTimeout</b></a>
<pre>
 public abstract int getQueryTimeout() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The queryTimeout limit is the number of seconds the driver will
 wait for a Statement to execute. If the limit is exceeded, a
 SQLException is thrown.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the current query timeout limit in seconds; zero means unlimited
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="setQueryTimeout(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setQueryTimeout"><b>setQueryTimeout</b></a>
<pre>
 public abstract void setQueryTimeout(int seconds) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The queryTimeout limit is the number of seconds the driver will
 wait for a Statement to execute. If the limit is exceeded, a
 SQLException is thrown.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> seconds - the new query timeout limit in seconds; zero means unlimited
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="cancel()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="cancel"><b>cancel</b></a>
<pre>
 public abstract void cancel() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Cancel can be used by one thread to cancel a statement that
 is being executed by another thread.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="getWarnings()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getWarnings"><b>getWarnings</b></a>
<pre>
 public abstract <a href="java.sql.SQLWarning.html#_top_">SQLWarning</a> getWarnings() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> The first warning reported by calls on this Statement is
 returned.  A Statment's execute methods clear its SQLWarning
 chain. Subsequent Statement warnings will be chained to this
 SQLWarning.
 <p>The warning chain is automatically cleared each time
 a statement is (re)executed.
 <P><B>Note:</B> If you are processing a ResultSet then any
 warnings associated with ResultSet reads will be chained on the
 ResultSet object.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the first SQLWarning or null
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="clearWarnings()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="clearWarnings"><b>clearWarnings</b></a>
<pre>
 public abstract void clearWarnings() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> After this call, getWarnings returns null until a new warning is
 reported for this Statement.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="setCursorName(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setCursorName"><b>setCursorName</b></a>
<pre>
 public abstract void setCursorName(<a href="java.lang.String.html#_top_">String</a> name) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> setCursorname defines the SQL cursor name that will be used by
 subsequent Statement execute methods. This name can then be
 used in SQL positioned update/delete statements to identify the
 current row in the ResultSet generated by this statement.  If
 the database doesn't support positioned update/delete, this
 method is a noop.
 <P><B>Note:</B> By definition, positioned update/delete
 execution must be done by a different Statement than the one
 which generated the ResultSet being used for positioning. Also,
 cursor names must be unique within a Connection.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the new cursor name.
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
  </dl></dd>
</dl>
<a name="execute(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="execute"><b>execute</b></a>
<pre>
 public abstract boolean execute(<a href="java.lang.String.html#_top_">String</a> sql) throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> Execute a SQL statement that may return multiple results.
 Under some (uncommon) situations a single SQL statement may return
 multiple result sets and/or update counts.  Normally you can ignore
 this, unless you're executing a stored procedure that you know may
 return multiple results, or unless you're dynamically executing an
 unknown SQL string.  The "execute", "getMoreResults", "getResultSet"
 and "getUpdateCount" methods let you navigate through multiple results.
 The "execute" method executes a SQL statement and indicates the
 form of the first result.  You can then use getResultSet or
 getUpdateCount to retrieve the result, and getMoreResults to
 move to any subsequent result(s).
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> sql - any SQL statement
    <dt> <b>Returns:</b>
    <dd> true if the next result is a ResultSet; false if it is
 an update count or there are no more results
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
    <dt> <b>See Also:</b>
    <dd> <a href="#getResultSet">getResultSet</a>, <a href="#getUpdateCount">getUpdateCount</a>, <a href="#getMoreResults">getMoreResults</a>
  </dl></dd>
</dl>
<a name="getResultSet()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getResultSet"><b>getResultSet</b></a>
<pre>
 public abstract <a href="java.sql.ResultSet.html#_top_">ResultSet</a> getResultSet() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> getResultSet returns the current result as a ResultSet.  It
  should only be called once per result.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the current result as a ResultSet; null if the result
 is an update count or there are no more results
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
    <dt> <b>See Also:</b>
    <dd> <a href="#execute">execute</a>
  </dl></dd>
</dl>
<a name="getUpdateCount()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getUpdateCount"><b>getUpdateCount</b></a>
<pre>
 public abstract int getUpdateCount() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> getUpdateCount returns the current result as an update count;
  if the result is a ResultSet or there are no more results, -1
  is returned.  It should only be called once per result.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the current result as an update count; -1 if it is a
 ResultSet or there are no more results
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
    <dt> <b>See Also:</b>
    <dd> <a href="#execute">execute</a>
  </dl></dd>
</dl>
<a name="getMoreResults()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getMoreResults"><b>getMoreResults</b></a>
<pre>
 public abstract boolean getMoreResults() throws <a href="java.sql.SQLException.html#_top_">SQLException</a>
</pre>
<dl>
  <dd> getMoreResults moves to a Statement's next result.  It returns true if 
 this result is a ResultSet.  getMoreResults also implicitly
 closes any current ResultSet obtained with getResultSet.
 There are no more results when (!getMoreResults() &&
 (getUpdateCount() == -1)
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> true if the next result is a ResultSet; false if it is
 an update count or there are no more results
    <dt> <b>Throws:</b> <a href="java.sql.SQLException.html#_top_">SQLException</a>
    <dd> if a database-access error occurs.
    <dt> <b>See Also:</b>
    <dd> <a href="#execute">execute</a>
  </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="java.sql.ResultSetMetaData.html#_top_">Previous</a>  <a href="Package-java.sql.html">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
