Top Description Fields Constructors Methods
org.apache.derby.iapi.jdbc

public Class BrokeredStatement

extends Object
implements EngineStatement
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.jdbc.EngineStatement, java.sql.Statement, java.lang.AutoCloseable, java.sql.Wrapper
Known Direct Subclasses
org.apache.derby.iapi.jdbc.BrokeredPreparedStatement
Imports
org.apache.derby.shared.common.error.ExceptionFactory, org.apache.derby.shared.common.reference.SQLState, java.sql.Connection, .ResultSet, .SQLException, .SQLWarning, .Statement

A Statement implementation that forwards all of its requests to an underlying Statement. This class implements the JDBC 4.1 interface.

Field Summary

Modifier and TypeField and Description
pack-priv final BrokeredStatementControl
control

My control.

private String
cursorName

My state

private Boolean
pack-priv final int
pack-priv final int
pack-priv final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final void
addBatch(String
typically this is a SQL INSERT or UPDATE statement
sql
)

Implements java.sql.Statement.addBatch.

Adds the given SQL command to the current list of commands for this Statement object.

public final void
cancel()

Implements java.sql.Statement.cancel.

Cancels this Statement object if both the DBMS and driver support aborting an SQL statement.

protected final void
checkIfClosed()

Checks if the statement is closed and throws an exception if it is.

public final void
clearBatch()

Implements java.sql.Statement.clearBatch.

Empties this Statement object's current list of SQL commands.

public final void
clearWarnings()

Implements java.sql.Statement.clearWarnings.

After this call getWarnings returns null until a new warning is reported for this Statement.

public void
close()

Implements java.sql.Statement.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.

public void
closeOnCompletion()

Implements org.apache.derby.iapi.jdbc.EngineStatement.closeOnCompletion.

Specifies that this Statement will be closed when all its dependent result sets are closed.

pack-priv final BrokeredStatementControl
controlCheck()

Get the BrokeredStatementControl in order to perform a check.

public Statement
public final boolean
execute(String
any SQL statement
sql
)

Implements java.sql.Statement.execute.

Executes the given SQL statement, which may return multiple results.

public final boolean
execute(String
any SQL statement
sql
,
int
a constant indicating whether auto-generated keys should be made available for retrieval using the method getGeneratedKeys; one of the following constants: Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
autoGeneratedKeys
)

Implements java.sql.Statement.execute.

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 final boolean
execute(String
any 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 getGeneratedKeys
columnIndexes
)

Implements java.sql.Statement.execute.

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 final boolean
execute(String
any 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 getGeneratedKeys
columnNames
)

Implements java.sql.Statement.execute.

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 final int[]
executeBatch()

Implements java.sql.Statement.executeBatch.

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

public long[]
executeLargeBatch()

Implements org.apache.derby.iapi.jdbc.EngineStatement.executeLargeBatch.

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.

public long
executeLargeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
)

Implements org.apache.derby.iapi.jdbc.EngineStatement.executeLargeUpdate.

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

public long
executeLargeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
,
int
a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS
autoGeneratedKeys
)

Implements org.apache.derby.iapi.jdbc.EngineStatement.executeLargeUpdate.

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 long
executeLargeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
,
int[]
an array of column indexes indicating the columns that should be returned from the inserted row
columnIndexes
)

Implements org.apache.derby.iapi.jdbc.EngineStatement.executeLargeUpdate.

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
executeLargeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
,
String[]
an array of the names of the columns that should be returned from the inserted row
columnNames
)

Implements org.apache.derby.iapi.jdbc.EngineStatement.executeLargeUpdate.

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 final ResultSet
executeQuery(String
an SQL statement to be sent to the database, typically a static SQL SELECT statement
sql
)

Implements java.sql.Statement.executeQuery.

Executes the given SQL statement, which returns a single ResultSet object.

public final int
executeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
)

Implements java.sql.Statement.executeUpdate.

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

public final int
executeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
,
int
a flag indicating whether auto-generated keys should be made available for retrieval; one of the following constants: Statement.RETURN_GENERATED_KEYS Statement.NO_GENERATED_KEYS
autoGeneratedKeys
)

Implements java.sql.Statement.executeUpdate.

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 final int
executeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
,
int[]
an array of column indexes indicating the columns that should be returned from the inserted row
columnIndexes
)

Implements java.sql.Statement.executeUpdate.

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 final int
executeUpdate(String
an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.
sql
,
String[]
an array of the names of the columns that should be returned from the inserted row
columnNames
)

Implements java.sql.Statement.executeUpdate.

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 final Connection
getConnection()

Implements java.sql.Statement.getConnection.

Retrieves the Connection object that produced this Statement object.

public final int
getFetchDirection()

Implements java.sql.Statement.getFetchDirection.

Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.

public final int
getFetchSize()

Implements java.sql.Statement.getFetchSize.

Retrieves the number of result set rows that is the default fetch size for ResultSet objects generated from this Statement object.

public final ResultSet

Returns:

a ResultSet object containing the auto-generated key(s) generated by the execution of this Statement object
getGeneratedKeys
()

Implements java.sql.Statement.getGeneratedKeys.

JDBC 3.0 Retrieves any auto-generated keys created as a result of executing this Statement object.

public long
getLargeMaxRows()

Implements org.apache.derby.iapi.jdbc.EngineStatement.getLargeMaxRows.

Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

public long
getLargeUpdateCount()

Implements org.apache.derby.iapi.jdbc.EngineStatement.getLargeUpdateCount.

Retrieves the current result as an update count; if the result is a ResultSet object or there are no more results, -1 is returned.

public final int
getMaxFieldSize()

Implements java.sql.Statement.getMaxFieldSize.

Retrieves the maximum number of bytes that can be returned for character and binary column values in a ResultSet object produced by this Statement object.

public final int
getMaxRows()

Implements java.sql.Statement.getMaxRows.

Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain.

public final boolean

Returns:

true if the next result is a ResultSet; false if it is an update count or there are no more results
getMoreResults
()

Implements java.sql.Statement.getMoreResults.

getMoreResults moves to a Statement's next result.

public final boolean

Returns:

true if the next result is a ResultSet; false if it is an update count or there are no more results
getMoreResults
(int
- one of the following Statement constants indicating what should happen to current ResultSet objects obtained using the method getResultSetCLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS
current
)

Implements java.sql.Statement.getMoreResults.

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

public final int
getQueryTimeout()

Implements java.sql.Statement.getQueryTimeout.

Retrieves the number of seconds the driver will wait for a Statement object to execute.

public final ResultSet

Returns:

the current result as a ResultSet; null if the result is an update count or there are no more results or the statement was closed.
getResultSet
()

Implements java.sql.Statement.getResultSet.

getResultSet returns the current result as a ResultSet.

public final int
getResultSetConcurrency()

Implements java.sql.Statement.getResultSetConcurrency.

Retrieves the result set concurrency for ResultSet objects generated by this Statement object.

public final int
getResultSetHoldability()

Implements java.sql.Statement.getResultSetHoldability.

Return the holdability of ResultSets created by this Statement.

public final int
getResultSetType()

Implements java.sql.Statement.getResultSetType.

JDBC 2.0 Determine the result set type.

public Statement
public final int

Returns:

the current result as an update count; -1 if it is a ResultSet or there are no more results
getUpdateCount
()

Implements java.sql.Statement.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.

public final SQLWarning

Returns:

the first SQLWarning or null
getWarnings
()

Implements java.sql.Statement.getWarnings.

The first warning reported by calls on this Statement is returned.

public final boolean

Returns:

true if the statement is closed, false otherwise
isClosed
()

Implements java.sql.Statement.isClosed.

Checks if the statement is closed.

public boolean
isCloseOnCompletion()

Implements org.apache.derby.iapi.jdbc.EngineStatement.isCloseOnCompletion.

Returns a value indicating whether this Statement will be closed when all its dependent result sets are closed.

public final boolean

Returns:

true if the underlying Statement is poolable, false otherwise.
isPoolable
()

Implements java.sql.Statement.isPoolable.

Forwards to the real Statement.

public boolean

Returns:

true if this implements the interface or directly or indirectly wraps an object that does.
isWrapperFor
(Class<T>
a Class defining an interface.
iface
)

Implements java.sql.Wrapper.isWrapperFor.

Returns false unless iface is implemented

public final void
setCursorName(String
the new cursor name.
name
)

Implements java.sql.Statement.setCursorName.

setCursorName defines the SQL cursor name that will be used by subsequent Statement execute methods.

public final void
setEscapeProcessing(boolean
true to enable; false to disable
enable
)

Implements java.sql.Statement.setEscapeProcessing.

If escape scanning is on (the default) the driver will do escape substitution before sending the SQL to the database.

public final void
setFetchDirection(int
the initial direction for processing rows
direction
)

Implements java.sql.Statement.setFetchDirection.

JDBC 2.0 Give a hint as to the direction in which the rows in a result set will be processed.

public final void
setFetchSize(int
the number of rows to fetch
rows
)

Implements java.sql.Statement.setFetchSize.

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.

public void
setLargeMaxRows(long
the new max rows limit; zero means there is no limit
max
)

Implements org.apache.derby.iapi.jdbc.EngineStatement.setLargeMaxRows.

Sets the limit for the maximum number of rows that any ResultSet object generated by this Statement object can contain to the given number.

public final void
setMaxFieldSize(int
the new max column size limit; zero means unlimited
max
)

Implements java.sql.Statement.setMaxFieldSize.

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.

public final void
setMaxRows(int
the new max rows limit; zero means unlimited
max
)

Implements java.sql.Statement.setMaxRows.

The maxRows limit is set to limit the number of rows that any ResultSet can contain.

public final void
setPoolable(boolean
the new value for the poolable hint.
poolable
)

Implements java.sql.Statement.setPoolable.

Forwards to the real Statement.

public final void
setQueryTimeout(int
the new query timeout limit in seconds; zero means there is no limit
seconds
)

Implements java.sql.Statement.setQueryTimeout.

Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds.

pack-priv void
setStatementState(Statement oldStatement, Statement newStatement)

pack-priv final SQLException

Returns:

an exception indicating that unwrap failed
unableToUnwrap
(Class<T>
the class or interface passed in to the failed unwrap call
iface
)

Return an exception that reports that an unwrap operation has failed because the object couldn't be cast to the specified interface.

public <T> T

Returns:

an object that implements the interface
unwrap
(Class<T>
a class defining an interface
iface
)

Implements java.sql.Wrapper.unwrap.

Returns this if this class implements the specified interface.

pack-priv final ResultSet
wrapResultSet(ResultSet
ResultSet being returned, can be null.
rs
)

Provide the control access to every ResultSet we return.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait