By default, only one ResultSet object per Statement
object can be open at the same time. Therefore, if the reading of one
ResultSet object is interleaved
with the reading of another, each must have been generated by
different Statement objects. All execution methods in the
Statement interface implicitly close a current
ResultSet object of the statement if an open one exists.
HSQLDB-Specific Information:
From version 2.0, the implementation meets the JDBC specification requirement that any existing ResultSet is closed when execute() or executeQuery() methods are called. The connection property close_result=true is required for this behaviour.Methods added in JAVA 8 are generally supported.
(fredt@users)
(campbell-burnet@users)
JDBCConnection#createStatement, JDBCResultSet
| Modifier and Type | Field and Description |
|---|---|
| pack-priv boolean | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv | JDBCStatement(JDBCConnection
the connection on which this statement will execute c, int props)Constructs a new JDBCStatement with the specified connection and result type. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addBatch(String
typically this is a SQL sql)INSERT or
UPDATE statementImplements java. Adds the given SQL command to the current list of commands for this
|
| public void | cancel()
Implements java. Cancels this |
| public synchronized void | clearBatch()
Implements java. Empties this |
| public synchronized void | clearWarnings()
Implements java. Clears all the warnings reported on this |
| public synchronized void | close()
Overrides org. Implements java. Releases this |
| public synchronized boolean | Returns: true if the first result is a ResultSet
object; false if it is an update count or there are
no resultsany SQL statement sql)Implements java. Executes the given SQL statement, which may return multiple results. |
| public synchronized boolean | Returns: true if the first result is a ResultSet
object; false if it is an update count or there are
no resultsany SQL statement sql, int a constant indicating whether auto-generated
keys should be made available for retrieval using the method
autoGeneratedKeys)getGeneratedKeys; one of the following constants:
Statement.RETURN_GENERATED_KEYS or
Statement.NO_GENERATED_KEYSImplements java. Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. |
| public synchronized boolean | Returns: true if the first result is a ResultSet
object; false if it is an update count or there
are no resultsany SQL statement sql, int[] an array of the indexes of the columns in the
inserted row that should be made available for retrieval by a
call to the method columnIndexes)getGeneratedKeysImplements java. Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
| public synchronized boolean | Returns: true if the next result is a ResultSet
object; false if it is an update count or there
are no more resultsany SQL statement sql, String[] an array of the names of the columns in the inserted
row that should be made available for retrieval by a call to the
method columnNames)getGeneratedKeysImplements java. Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
| public synchronized int[] | Returns: an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.Implements java. Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. |
| public long[] | Returns: an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which commands were added to the batch.Overrides default java. Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. |
| public long | Returns: either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothingan SQL Data Manipulation Language (DML) statement,
such as sql)INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.Overrides default java. Executes the given SQL statement, which may be an |
| public long | Returns: either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothingan SQL Data Manipulation Language (DML) statement,
such as sql, int INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.a flag indicating whether auto-generated keys
should be made available for retrieval;
one of the following constants:
autoGeneratedKeys)Statement.RETURN_GENERATED_KEYS
Statement.NO_GENERATED_KEYSOverrides default java. Executes the given SQL statement and signals the driver with the
given flag about whether the
auto-generated keys produced by this |
| public long | Returns: either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothingan SQL Data Manipulation Language (DML) statement,
such as sql, int[] INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.an array of column indexes indicating the columns
that should be returned from the inserted row columnIndexes)Overrides default java. Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
| public long | Returns: either the row count forINSERT, UPDATE,
or DELETE statements, or 0 for SQL statements
that return nothingan SQL Data Manipulation Language (DML) statement,
such as sql, String[] INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.an array of the names of the columns that should be
returned from the inserted row columnNames)Overrides default java. Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
| public synchronized ResultSet | Returns: aResultSet object that contains the data produced
by the given query; never nullan SQL statement to be sent to the database, typically a
static SQL sql)SELECT statementImplements java. Executes the given SQL statement, which returns a single
|
| public synchronized int | Returns: either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothingan SQL Data Manipulation Language (DML) statement, such as sql)INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.Implements java. Executes the given SQL statement, which may be an |
| public synchronized int | Returns: either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothingan SQL Data Manipulation Language (DML) statement, such as sql, int INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.a flag indicating whether auto-generated keys
should be made available for retrieval;
one of the following constants:
autoGeneratedKeys)Statement.RETURN_GENERATED_KEYS
Statement.NO_GENERATED_KEYSImplements java. Executes the given SQL statement and signals the driver with the
given flag about whether the
auto-generated keys produced by this |
| public synchronized int | Returns: either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothingan SQL Data Manipulation Language (DML) statement, such as sql, int[] INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.an array of column indexes indicating the columns
that should be returned from the inserted row columnIndexes)Implements java. Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
| public synchronized int | Returns: either the row count forINSERT, UPDATE,
or DELETE statements, or 0 for SQL statements
that return nothingan SQL Data Manipulation Language (DML) statement, such as sql, String[] INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing,
such as a DDL statement.an array of the names of the columns that should be
returned from the inserted row columnNames)Implements java. Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. |
| private void | fetchResult(String
a character sequence representing the SQL to be executed sql, int int statementRetType, int int generatedKeys, int[] int[] generatedIndexes, String[] String[] generatedNames)Internal result producer for JDBCStatement (sqlExecDirect mode). |
| public synchronized Connection | Returns: the connection that produced this statementImplements java. Retrieves the |
| public int | Returns: the default fetch direction for result sets generated from thisStatement objectImplements java. Retrieves the direction for fetching rows from
database tables that is the default for result sets
generated from this |
| public synchronized int | Returns: the default fetch size for result sets generated from thisStatement objectImplements java. Retrieves the number of result set rows that is the default
fetch size for |
| public synchronized ResultSet | Returns: aResultSet object containing the auto-generated key(s)
generated by the execution of this Statement objectImplements java. Retrieves any auto-generated keys created as a result of executing this
|
| public long | Returns: the current maximum number of rows for aResultSet
object produced by this Statement object;
zero means there is no limitOverrides default java. Retrieves the maximum number of rows that a
|
| public long | Returns: the current result as an update count; -1 if the current result is aResultSet object or there are no more resultsOverrides default java. Retrieves the current result as an update count; if the result
is a |
| public synchronized int | Returns: the current column size limit for columns storing character and binary values; zero means there is no limitImplements java. Retrieves the maximum number of bytes that can be
returned for character and binary column values in a |
| public synchronized int | Returns: the current maximum number of rows for aResultSet
object produced by this Statement object;
zero means there is no limitImplements java. Retrieves the maximum number of rows that a
|
| public synchronized boolean | Returns: true if the next result is a ResultSet
object; false if it is an update count or there are
no more resultsOverrides org. Implements java. Moves to this |
| public synchronized boolean | Returns: true if the next result is a ResultSet
object; false if it is an update count or there are no
more resultsone of the following current)Statement
constants indicating what should happen to current
ResultSet objects obtained using the method
getResultSet:
Statement.CLOSE_CURRENT_RESULT,
Statement.KEEP_CURRENT_RESULT, or
Statement.CLOSE_ALL_RESULTSOverrides org. Implements java. Moves to this |
| public synchronized int | Returns: the current query timeout limit in seconds; zero means there is no limitImplements java. Retrieves the number of seconds the driver will
wait for a |
| public synchronized ResultSet | Returns: the current result as aResultSet object or
null if the result is an update count or there are no more resultsOverrides org. Implements java. Retrieves the current result as a |
| public synchronized int | Returns: eitherResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLEImplements java. Retrieves the result set concurrency for |
| public synchronized int | Returns: eitherResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITImplements java. Retrieves the result set holdability for |
| public int | |
| public synchronized int | Returns: one ofResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEImplements java. Retrieves the result set type for |
| public synchronized int | Returns: the current result as an update count; -1 if the current result is aResultSet object or there are no more resultsOverrides org. Implements java. Retrieves the current result as an update count;
if the result is a |
| public synchronized SQLWarning | Returns: the firstSQLWarning object or null
if there are no warningsImplements java. Retrieves the first warning reported by calls on this |
| public synchronized boolean | Returns: true if thisStatement object is closed; false if it is still openImplements java. Retrieves whether this |
| public synchronized boolean | Returns: true if the Statement will be closed when all
of its dependent result sets are closed; false otherwiseImplements java. Returns a value indicating whether this |
| public boolean | Returns: true if this implements the interface or directly or indirectly wraps an object that does.a Class defining an interface. iface)Implements java. Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. |
| public void | setCursorName(String
the new cursor name, which must be unique within
a connection name)Implements java. Sets the SQL cursor name to the given |
| public void | setEscapeProcessing(boolean
true to enable escape processing;
false to disable itImplements java. Sets escape processing on or off. |
| public synchronized void | setFetchDirection(int
the initial direction for processing rows direction)Implements java. Gives the driver a hint as to the direction in which
rows will be processed in |
| public synchronized void | setFetchSize(int
the number of rows to fetch rows)Implements java. Gives the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed for
|
| public void | setLargeMaxRows(long
the new max rows limit; zero means there is no limit max)Overrides default java. Sets the limit for the maximum number of rows that any
|
| public void | setMaxFieldSize(int
the new column size limit in bytes; zero means there is no limit max)Implements java. Sets the limit for the maximum number of bytes in a |
| public synchronized void | setMaxRows(int
the new max rows limit; zero means there is no limit max)Implements java. Sets the limit for the maximum number of rows that any
|
| public synchronized void | setPoolable(boolean
requests that the statement be pooled if true and
that the statement not be pooled if false poolable)Implements java. Requests that a |
| public void | setQueryTimeout(int
the new query timeout limit in seconds; zero means
there is no limit seconds)Implements java. Sets the number of seconds the driver will wait for a
|
| public <T> T | Returns: an object that implements the interface. May be a proxy for the actual implementing object.A Class defining an interface that the result must implement. iface)Implements java. Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. |