| java.lang.Object org.apache.derby.iapi.jdbc.BrokeredStatement
All known Subclasses: org.apache.derby.iapi.jdbc.BrokeredStatement40, org.apache.derby.iapi.jdbc.BrokeredPreparedStatement,
BrokeredStatement | public class BrokeredStatement implements EngineStatement(Code) | | A Statement implementation that forwards all of its requests to an underlying Statement.
|
Method Summary | |
final public void | addBatch(String sql) | final public void | cancel() | final protected void | checkIfClosed() Checks if the statement is closed and throws an exception if it
is. | final public void | clearBatch() | final public void | clearWarnings() After this call getWarnings returns null until a new warning is
reported for this Statement. | final public void | close() 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.
Note: A Statement is automatically closed when it is
garbage collected. | final BrokeredStatementControl | controlCheck() Get the BrokeredStatementControl in order to perform a check. | public Statement | createDuplicateStatement(Connection conn, Statement oldStatement) | final public boolean | execute(String sql) | final public boolean | execute(String sql, int autoGeneratedKeys) | final public boolean | execute(String sql, int[] columnIndexes) | final public boolean | execute(String sql, String[] columnNames) | final public int[] | executeBatch() | final public ResultSet | executeQuery(String sql) | final public int | executeUpdate(String sql) | final public int | executeUpdate(String sql, int autoGeneratedKeys) | final public int | executeUpdate(String sql, int[] columnIndexes) | final public int | executeUpdate(String sql, String[] columnNames) | final public Connection | getConnection() | final public int | getFetchDirection() | final public int | getFetchSize() | final public ResultSet | getGeneratedKeys() JDBC 3.0
Retrieves any auto-generated keys created as a result of executing this
Statement object. | final public int | getMaxFieldSize() | final public int | getMaxRows() | final public boolean | getMoreResults() getMoreResults moves to a Statement's next result. | final public boolean | getMoreResults(int current) | final public int | getQueryTimeout() | final public ResultSet | getResultSet() getResultSet returns the current result as a ResultSet. | final public int | getResultSetConcurrency() | final public int | getResultSetHoldability() Return the holdability of ResultSets created by this Statement.
If this Statement is active in a global transaction the
CLOSE_CURSORS_ON_COMMIT will be returned regardless of
the holdability it was created with. | final public int | getResultSetType() JDBC 2.0
Determine the result set type. | public Statement | getStatement() | final public int | getUpdateCount() getUpdateCount returns the current result as an update count;
if the result is a ResultSet or there are no more results -1
is returned. | final public SQLWarning | getWarnings() The first warning reported by calls on this Statement is
returned. | protected boolean | isClosed() Checks if the statement is closed. | public boolean | isWrapperFor(Class iface) Returns false unless iface is implemented
Parameters: iface - a Class defining an interface. | final public void | setCursorName(String name) setCursorName defines the SQL cursor name that will be used by
subsequent Statement execute methods. | final public void | setEscapeProcessing(boolean enable) If escape scanning is on (the default) the driver will do
escape substitution before sending the SQL to the database. | final public void | setFetchDirection(int direction) JDBC 2.0
Give a hint as to the direction in which the rows in a result set
will be processed. | final public void | setFetchSize(int rows) JDBC 2.0
Give the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed. | final public void | setMaxFieldSize(int max) 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. | final public void | setMaxRows(int max) The maxRows limit is set to limit the number of rows that any
ResultSet can contain. | final public void | setQueryTimeout(int seconds) | void | setStatementState(Statement oldStatement, Statement newStatement) | final ResultSet | wrapResultSet(ResultSet rs) Provide the control access to every ResultSet we return. |
control | final BrokeredStatementControl control(Code) | | My control. Use the controlCheck() method to obtain the control
when calling a check method. This will result in the correct exception
being thrown if the statement is already closed.
|
jdbcLevel | final int jdbcLevel(Code) | | |
resultSetConcurrency | final int resultSetConcurrency(Code) | | |
resultSetHoldability | final int resultSetHoldability(Code) | | |
resultSetType | final int resultSetType(Code) | | |
checkIfClosed | final protected void checkIfClosed() throws SQLException(Code) | | Checks if the statement is closed and throws an exception if it
is. This method relies on the isClosed() method
and therefore only works with JDBC 4.0.
exception: SQLException - if the statement is closed |
clearWarnings | final public void clearWarnings() throws SQLException(Code) | | After this call getWarnings returns null until a new warning is
reported for this Statement.
exception: SQLException - thrown on failure. |
close | final public void close() throws SQLException(Code) | | 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.
Note: A Statement is automatically closed when it is
garbage collected. When a Statement is closed its current
ResultSet, if one exists, is also closed.
exception: SQLException - thrown on failure. |
controlCheck | final BrokeredStatementControl controlCheck() throws SQLException(Code) | | Get the BrokeredStatementControl in order to perform a check.
Obtained indirectly to ensure that the correct exception is
thrown if the Statement has been closed.
|
getGeneratedKeys | final public ResultSet getGeneratedKeys() throws SQLException(Code) | | JDBC 3.0
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. If this Statement is a non-insert statement,
an exception will be thrown.
a ResultSet object containing the auto-generated key(s) generated bythe execution of this Statement object exception: SQLException - if a database access error occurs |
getMoreResults | final public boolean getMoreResults() throws SQLException(Code) | | 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)
true if the next result is a ResultSet; false if it isan update count or there are no more results See Also: BrokeredStatement.execute exception: SQLException - thrown on failure. |
getMoreResults | final public boolean getMoreResults(int current) throws SQLException(Code) | | JDBC 3.0
Moves to this Statement obect'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
Parameters: current - - one of the following Statement constants indicating whatshould happen to current ResultSet objects obtained using the methodgetResultSetCLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS true if the next result is a ResultSet; false if it isan update count or there are no more results See Also: BrokeredStatement.execute exception: SQLException - thrown on failure. |
getResultSet | final public ResultSet getResultSet() throws SQLException(Code) | | getResultSet returns the current result as a ResultSet. It
should only be called once per result.
the current result as a ResultSet; null if the resultis an update count or there are no more results or the statementwas closed. See Also: BrokeredStatement.execute |
getResultSetConcurrency | final public int getResultSetConcurrency() throws SQLException(Code) | | |
getResultSetHoldability | final public int getResultSetHoldability() throws SQLException(Code) | | Return the holdability of ResultSets created by this Statement.
If this Statement is active in a global transaction the
CLOSE_CURSORS_ON_COMMIT will be returned regardless of
the holdability it was created with. In a local transaction
the original create holdabilty will be returned.
|
getResultSetType | final public int getResultSetType() throws SQLException(Code) | | JDBC 2.0
Determine the result set type.
exception: SQLException - Feature not implemented for now. |
getUpdateCount | final public int getUpdateCount() throws SQLException(Code) | | 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.
The only way to tell for sure that the result is an update
count is to first test to see if it is a ResultSet. If it is
not a ResultSet it is either an update count or there are no
more results.
the current result as an update count; -1 if it is aResultSet or there are no more results See Also: BrokeredStatement.execute |
getWarnings | final public SQLWarning getWarnings() throws SQLException(Code) | | 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.
The warning chain is automatically cleared each time
a statement is (re)executed.
Note: If you are processing a ResultSet then any
warnings associated with ResultSet reads will be chained on the
ResultSet object.
the first SQLWarning or null exception: SQLException - thrown on failure. |
isClosed | protected boolean isClosed() throws SQLException(Code) | | Checks if the statement is closed. Not implemented for this
class since isClosed() is a new method in JDBC
4.0. The JDBC 4.0 sub-classes should override this method.
true if the statement is closed,false otherwise exception: SQLException - not-implemented exception |
isWrapperFor | public boolean isWrapperFor(Class iface) throws SQLException(Code) | | Returns false unless iface is implemented
Parameters: iface - a Class defining an interface. true if this implements the interface or directly or indirectly wraps an object that does. throws: java.sql.SQLException - if an error occurs while determining whether this is a wrapper for an object with the given interface. |
setCursorName | final public void setCursorName(String name) throws SQLException(Code) | | 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 getStatement(). If
the database doesn't support positioned update/delete, this
method is a noop.
Note: 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.
Parameters: name - the new cursor name. |
setEscapeProcessing | final public void setEscapeProcessing(boolean enable) throws SQLException(Code) | | If escape scanning is on (the default) the driver will do
escape substitution before sending the SQL to the database.
Parameters: enable - true to enable; false to disable exception: SQLException - thrown on failure. |
setFetchDirection | final public void setFetchDirection(int direction) throws SQLException(Code) | | JDBC 2.0
Give a hint as to the direction in which the rows in a result set
will be processed. The hint applies only to result sets created
using this Statement object. The default value is
ResultSet.FETCH_FORWARD.
Parameters: direction - the initial direction for processing rows exception: SQLException - if a database-access error occurs or directionis not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, orResultSet.FETCH_UNKNOWN |
setFetchSize | final public void setFetchSize(int rows) throws SQLException(Code) | | JDBC 2.0
Give the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed. The number
of rows specified only affects result sets created using this
getStatement(). If the value specified is zero, then the hint is ignored.
The default value is zero.
Parameters: rows - the number of rows to fetch exception: SQLException - if a database-access error occurs, or thecondition 0 <= rows <= this.getMaxRows() is not satisfied. |
setMaxFieldSize | final public void setMaxFieldSize(int max) throws SQLException(Code) | | 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.
Parameters: max - the new max column size limit; zero means unlimited exception: SQLException - thrown on failure. |
setMaxRows | final public void setMaxRows(int max) throws SQLException(Code) | | 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.
Parameters: max - the new max rows limit; zero means unlimited exception: SQLException - thrown on failure. |
wrapResultSet | final ResultSet wrapResultSet(ResultSet rs)(Code) | | Provide the control access to every ResultSet we return.
If required the control can wrap the ResultSet, but
it (the control) must ensure a underlying ResultSet is
only wrapped once, if say java.sql.Statement.getResultSet
is returned twice.
Parameters: rs - ResultSet being returned, can be null. |
|
|