| java.lang.Object com.quadcap.jdbc.Statement
All known Subclasses: com.quadcap.jdbc.PreparedStatement,
Statement | public class Statement implements java.sql.Statement(Code) | | This class implements the java.sql.Statement interface, which
provides facilities for executing SQL statements on a database
connection, as part of that connection's transaction.
TODO: setMaxFieldSize
TODO: setQueryTimeout
TODO: JDBC3.0: return generated keys
author: Stan Bailes |
Constructor Summary | |
public | Statement(Connection conn) | public | Statement(Connection conn, int resultSetType, int resultSetConcurrency) Create a new Statement with the specified result set type and
concurrency. |
Method Summary | |
public void | addBatch(String sql) This QED release doesn't support batch statement execution. | public void | cancel() QED does not support the cancel() feature. | public void | clearBatch() This QED release doesn't support batch statement execution. | public void | clearWarnings() Clear any warnings associated with this Statement
object. | public void | close() Close this statement object and free up any resources held by it. | public boolean | execute(String sql) Execute the specified SQL statement, returning true
if the statement generates a ResultSet object. | public boolean | execute(String sql, int autoGeneratedKeys) 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 boolean | execute(String sql, int columnIndexes) 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 boolean | execute(String sql, String columnNames) 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 int[] | executeBatch() This QED release doesn't support batch statement execution. | public java.sql.ResultSet | executeQuery(String sql) Execute the specified SQL query statement, returning the
ResultSet object containing the results of the
query. | public int | executeUpdate(String sql) Execute the specified SQL update statement, returning the update
count, meaning the number of rows updated or inserted by this
statement. | public int | executeUpdate(String sql, int autoGeneratedKeys) Executes the given SQL statement and signals the driver with the
given flag about whether the
auto-generated keys produced by this Statement object
should be made available for retrieval. | public int | executeUpdate(String sql, int columnIndexes) 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 int | executeUpdate(String sql, String columnNames) 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 void | finalize() | public java.sql.Connection | getConnection() Return the Connection object used to create this
Statement object. | public int | getFetchDirection() | public int | getFetchSize() In QED, the fetch size is always 1. | public java.sql.ResultSet | getGeneratedKeys() Retrieves any auto-generated keys created as a result of executing this
Statement object. | public int | getMaxFieldSize() QED imposes no maximum field size. | public int | getMaxRows() QED imposes no limit on the number of rows in a ResultSet . | public boolean | getMoreResults() QED only returns one ResultSet per statement, so
this function always returns false (after closing
the current ResultSet object for this
Statement . | public boolean | getMoreResults(int current) Moves to this Statement object's next result, deals with
any current ResultSet object(s) according to the
instructions specified by the given flag, and returns
true if the next result is a ResultSet object. | public int | getQueryTimeout() QED doesn't support query timeouts, so this method always returns
zero. | public java.sql.ResultSet | getResultSet() Return the ResultSet generated by the last call to
execute() , unless that ResultSet has
been closed, or if there was no ResultSet generated
by the last call to execute() , in which case, return
null . | public int | getResultSetConcurrency() Return the default result set concurrency for ResultSet
objects generated by this Statement object. | public int | getResultSetHoldability() Retrieves the result set holdability for ResultSet objects
generated by this Statement object. | public int | getResultSetType() Return the default result set type for ResultSet
objects generated by this Statement object. | public int | getUpdateCount() Return the update count for the last statement executed. | public SQLWarning | getWarnings() Since this QED release doesn't generate
SQLWarning s, this function always returns null. | public void | setCursorName(String name) | public void | setEscapeProcessing(boolean enable) Enable or disable JDBC escape processing mode. | public void | setFetchDirection(int dir) Set the default fetch direction for ResultSet objects
generated by this Statement object. | public void | setFetchSize(int x) QED, being an embedded driver, fetches rows only when they are
needed, with no performance penalty. | public void | setMaxFieldSize(int x) | public void | setMaxRows(int x) | public void | setQueryTimeout(int x) | public String | toString() |
escapeProcessing | protected boolean escapeProcessing(Code) | | |
resultSetConcurrency | int resultSetConcurrency(Code) | | |
resultSetType | int resultSetType(Code) | | |
updateCount | int updateCount(Code) | | |
Statement | public Statement(Connection conn, int resultSetType, int resultSetConcurrency) throws SQLException, IOException(Code) | | Create a new Statement with the specified result set type and
concurrency.
|
cancel | public void cancel() throws SQLException(Code) | | QED does not support the cancel() feature.
|
clearBatch | public void clearBatch() throws SQLException(Code) | | This QED release doesn't support batch statement execution.
exception: SQLException - "not implemented" |
clearWarnings | public void clearWarnings()(Code) | | Clear any warnings associated with this Statement
object. Since this QED release doesn't generate
SQLWarning s, this function does nothing.
|
close | public void close()(Code) | | Close this statement object and free up any resources held by it.
|
execute | public boolean execute(String sql) throws SQLException(Code) | | Execute the specified SQL statement, returning true
if the statement generates a ResultSet object.
Parameters: sql - an SQL statement true if execution of the statement results in the creationof a ResultSet See Also: Statement.getResultSet() exception: SQLException - may be thrown |
execute | public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code) | | 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. The driver will ignore this signal if the SQL statement
is not an INSERT statement.
In some (uncommon) situations, a single SQL statement may return
multiple result sets and/or update counts. Normally you can ignore
this unless you are (1) executing a stored procedure that you know may
return multiple results or (2) you are dynamically executing an
unknown SQL string.
The execute method executes an SQL statement and indicates the
form of the first result. You must then use the methods
getResultSet or getUpdateCount
to retrieve the result, and getMoreResults to
move to any subsequent result(s).
Parameters: sql - any SQL statement Parameters: autoGeneratedKeys - a constant indicating whether auto-generated keys should be made available for retrieval using the methodgetGeneratedKeys ; one of the following constants:Statement.RETURN_GENERATED_KEYS orStatement.NO_GENERATED_KEYS true if the first result is a ResultSet object; false if it is an update count or there areno results exception: SQLException - if a database access error occurs See Also: Statement.getResultSet See Also: Statement.getUpdateCount See Also: Statement.getMoreResults See Also: Statement.getGeneratedKeys since: 1.4 |
execute | public boolean execute(String sql, int columnIndexes) throws SQLException(Code) | | 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. This array contains the indexes of the columns in the
target table that contain the auto-generated keys that should be made
available. The driver will ignore the array if the given SQL statement
is not an INSERT statement.
Under some (uncommon) situations, a single SQL statement may return
multiple result sets and/or update counts. Normally you can ignore
this unless you are (1) executing a stored procedure that you know may
return multiple results or (2) you are dynamically executing an
unknown SQL string.
The execute method executes an SQL statement and indicates the
form of the first result. You must then use the methods
getResultSet or getUpdateCount
to retrieve the result, and getMoreResults to
move to any subsequent result(s).
Parameters: sql - any SQL statement Parameters: columnIndexes - an array of the indexes of the columns in the inserted row that should be made available for retrieval by acall to the method getGeneratedKeys true if the first result is a ResultSet object; false if it is an update count or there are no results exception: SQLException - if a database access error occurs See Also: Statement.getResultSet See Also: Statement.getUpdateCount See Also: Statement.getMoreResults since: 1.4 |
execute | public boolean execute(String sql, String columnNames) throws SQLException(Code) | | 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. This array contains the names of the columns in the
target table that contain the auto-generated keys that should be made
available. The driver will ignore the array if the given SQL statement
is not an INSERT statement.
In some (uncommon) situations, a single SQL statement may return
multiple result sets and/or update counts. Normally you can ignore
this unless you are (1) executing a stored procedure that you know may
return multiple results or (2) you are dynamically executing an
unknown SQL string.
The execute method executes an SQL statement and indicates the
form of the first result. You must then use the methods
getResultSet or getUpdateCount
to retrieve the result, and getMoreResults to
move to any subsequent result(s).
Parameters: sql - any SQL statement Parameters: columnNames - an array of the names of the columns in the insertedrow that should be made available for retrieval by a call to themethod getGeneratedKeys true if the next result is a ResultSet object; false if it is an update count or there are no more results exception: SQLException - if a database access error occurs See Also: Statement.getResultSet See Also: Statement.getUpdateCount See Also: Statement.getMoreResults See Also: Statement.getGeneratedKeys since: 1.4 |
executeBatch | public int[] executeBatch() throws SQLException(Code) | | This QED release doesn't support batch statement execution.
exception: SQLException - "not implemented" |
executeQuery | public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code) | | Execute the specified SQL query statement, returning the
ResultSet object containing the results of the
query.
Parameters: sql - an SQL query statement a ResultSet object containing the results ofthe query exception: SQLException - may be thrown |
executeUpdate | public int executeUpdate(String sql) throws SQLException(Code) | | Execute the specified SQL update statement, returning the update
count, meaning the number of rows updated or inserted by this
statement.
Parameters: sql - an SQL update statement the update count exception: SQLException - may be thrown |
executeUpdate | public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code) | | Executes the given SQL statement and signals the driver with the
given flag about whether the
auto-generated keys produced by this Statement object
should be made available for retrieval.
Parameters: sql - must be an SQL INSERT , UPDATE orDELETE statement or an SQL statement that returns nothing Parameters: autoGeneratedKeys - a flag indicating whether auto-generated keysshould be made available for retrieval;one of the following constants:Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS either the row count for INSERT ,UPDATE or DELETE statements, or 0 for SQL statements that return nothing exception: SQLException - if a database access error occurs, the givenSQL statement returns a ResultSet object, orthe given constant is not one of those allowed since: 1.4 |
executeUpdate | public int executeUpdate(String sql, int columnIndexes) throws SQLException(Code) | | 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. The driver will ignore the array if the
SQL statement is not an INSERT statement.
Parameters: sql - an SQL INSERT , UPDATE orDELETE statement or an SQL statement that returnsnothing, such as an SQL DDL statement Parameters: columnIndexes - an array of column indexes indicating the columnsthat should be returned from the inserted row either the row count for INSERT ,UPDATE ,or DELETE statements, or 0 for SQL statements that return nothing exception: SQLException - if a database access error occurs or the SQLstatement returns a ResultSet object since: 1.4 |
executeUpdate | public int executeUpdate(String sql, String columnNames) throws SQLException(Code) | | 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. The driver will ignore the array if the SQL statement
is not an INSERT statement.
Parameters: sql - an SQL INSERT , UPDATE orDELETE statement or an SQL statement that returns nothing Parameters: columnNames - an array of the names of the columns that should be returned from the inserted row either the row count for INSERT , UPDATE ,or DELETE statements, or 0 for SQL statements that return nothing exception: SQLException - if a database access error occurs since: 1.4 |
finalize | public void finalize() throws Throwable(Code) | | My short life is ended
|
getConnection | public java.sql.Connection getConnection()(Code) | | Return the Connection object used to create this
Statement object.
this statement's connection. |
getFetchDirection | public int getFetchDirection()(Code) | | This release of QED only supports the fetch direction:
ResultSet.FETCH_FORWARD
ResultSet.FETCH_FORWARD |
getFetchSize | public int getFetchSize()(Code) | | In QED, the fetch size is always 1.
one |
getGeneratedKeys | public java.sql.ResultSet getGeneratedKeys() throws SQLException(Code) | | Retrieves any auto-generated keys created as a result of executing this
Statement object. If this Statement object
did not generate any keys, an empty ResultSet
object is returned.
a ResultSet object containing the auto-generatedkey(s) generated by the execution of thisStatement object exception: SQLException - if a database access error occurs since: 1.4 |
getMaxFieldSize | public int getMaxFieldSize()(Code) | | QED imposes no maximum field size.
zero, meaning unlimited |
getMaxRows | public int getMaxRows()(Code) | | QED imposes no limit on the number of rows in a ResultSet .
zero, meaning unlimited |
getMoreResults | public boolean getMoreResults() throws SQLException(Code) | | QED only returns one ResultSet per statement, so
this function always returns false (after closing
the current ResultSet object for this
Statement .
false exception: SQLException - may be thrown |
getMoreResults | public boolean getMoreResults(int current) throws SQLException(Code) | | Moves to this Statement object's next result, deals with
any current ResultSet object(s) according to the
instructions specified by the given flag, and returns
true if the next result is a ResultSet object.
There are no more results when the following is true:
(!getMoreResults() && (getUpdateCount() == -1)
Parameters: current - one of the following Statement constants indicating what should happen to current ResultSet objects obtained using the methodgetResultSetCLOSE_CURRENT_RESULT , KEEP_CURRENT_RESULT , orCLOSE_ALL_RESULTS true if the next result is a ResultSet object; false if it is an update count or there are no more results exception: SQLException - if a database access error occurs since: 1.4 See Also: Statement.execute |
getQueryTimeout | public int getQueryTimeout()(Code) | | QED doesn't support query timeouts, so this method always returns
zero.
zero, meaning unlimited |
getResultSet | public java.sql.ResultSet getResultSet()(Code) | | Return the ResultSet generated by the last call to
execute() , unless that ResultSet has
been closed, or if there was no ResultSet generated
by the last call to execute() , in which case, return
null .
the current ResultSet |
getResultSetConcurrency | public int getResultSetConcurrency()(Code) | | Return the default result set concurrency for ResultSet
objects generated by this Statement object.
the default result set concurrency |
getResultSetHoldability | public int getResultSetHoldability() throws SQLException(Code) | | Retrieves the result set holdability for ResultSet objects
generated by this Statement object.
either ResultSet.HOLD_CURSORS_OVER_COMMIT orResultSet.CLOSE_CURSORS_AT_COMMIT exception: SQLException - if a database access error occurs since: 1.4 |
getResultSetType | public int getResultSetType()(Code) | | Return the default result set type for ResultSet
objects generated by this Statement object.
the default result set type |
getUpdateCount | public int getUpdateCount()(Code) | | Return the update count for the last statement executed. If no
records were updated, inserted, or deleted, return -1.
the update count for the last execute() operation |
getWarnings | public SQLWarning getWarnings()(Code) | | Since this QED release doesn't generate
SQLWarning s, this function always returns null.
null |
setEscapeProcessing | public void setEscapeProcessing(boolean enable)(Code) | | Enable or disable JDBC escape processing mode.
|
setFetchDirection | public void setFetchDirection(int dir) throws SQLException(Code) | | Set the default fetch direction for ResultSet objects
generated by this Statement object.
|
setFetchSize | public void setFetchSize(int x) throws SQLException(Code) | | QED, being an embedded driver, fetches rows only when they are
needed, with no performance penalty. Thus, the fetch size is
always one , and this function has no effect.
|
setMaxFieldSize | public void setMaxFieldSize(int x) throws SQLException(Code) | | Not implemented in this release of QED
exception: SQLException - "not implemented" |
setMaxRows | public void setMaxRows(int x) throws SQLException(Code) | | Set the maximum number of rows that will be returned by this
ResultSet
|
setQueryTimeout | public void setQueryTimeout(int x) throws SQLException(Code) | | Not implemented in this release of QED
exception: SQLException - "not implemented" |
|
|