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

public Interface EngineStatement

extends Statement
Known Direct Subinterfaces
org.apache.derby.iapi.jdbc.EngineCallableStatement, org.apache.derby.iapi.jdbc.EnginePreparedStatement
Known Direct Implementers
org.apache.derby.impl.jdbc.EmbedStatement, org.apache.derby.iapi.jdbc.BrokeredStatement
Imports
java.sql.SQLException, .Statement

Additional methods the embedded engine exposes on its Statement object implementations. An internal api only, mainly for the network server. Allows consistent interaction between emebdded statements and brokered statements.

Field Summary

Inherited from java.sql.Statement:
CLOSE_ALL_RESULTSCLOSE_CURRENT_RESULTEXECUTE_FAILEDKEEP_CURRENT_RESULTNO_GENERATED_KEYSRETURN_GENERATED_KEYSSUCCESS_NO_INFO

Method Summary

Modifier and TypeMethod and Description
public void
closeOnCompletion()

Redeclares java.sql.Statement.closeOnCompletion.

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

public long[]
executeLargeBatch()

Redeclares as abstract: java.sql.Statement.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
)

Redeclares as abstract: java.sql.Statement.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
)

Redeclares as abstract: java.sql.Statement.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
)

Redeclares as abstract: java.sql.Statement.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
)

Redeclares as abstract: java.sql.Statement.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
getLargeMaxRows()

Redeclares as abstract: java.sql.Statement.getLargeMaxRows.

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

public long
getLargeUpdateCount()

Redeclares as abstract: java.sql.Statement.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 boolean
isCloseOnCompletion()

Redeclares java.sql.Statement.isCloseOnCompletion.

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

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

Redeclares as abstract: java.sql.Statement.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.

Inherited from java.sql.Statement:
addBatchcancelclearBatchclearWarningscloseenquoteIdentifierenquoteLiteralenquoteNCharLiteralexecuteexecuteexecuteexecuteexecuteBatchexecuteQueryexecuteUpdateexecuteUpdateexecuteUpdateexecuteUpdategetConnectiongetFetchDirectiongetFetchSizegetGeneratedKeysgetMaxFieldSizegetMaxRowsgetMoreResultsgetMoreResultsgetQueryTimeoutgetResultSetgetResultSetConcurrencygetResultSetHoldabilitygetResultSetTypegetUpdateCountgetWarningsisClosedisPoolableisSimpleIdentifiersetCursorNamesetEscapeProcessingsetFetchDirectionsetFetchSizesetMaxFieldSizesetMaxRowssetPoolablesetQueryTimeout

Method Detail

closeOnCompletionback to summary
public void closeOnCompletion() throws SQLException

Redeclares java.sql.Statement.closeOnCompletion.

Doc from java.sql.Statement.closeOnCompletion.

Specifies that this Statement will be closed when all its dependent result sets are closed. If execution of the Statement does not produce any result sets, this method has no effect.

Note

Multiple calls to closeOnCompletion do not toggle the effect on this Statement. However, a call to closeOnCompletion does effect both the subsequent execution of statements, and statements that currently have open, dependent, result sets.

Exceptions
SQLException:
if this method is called on a closed Statement
executeLargeBatchback to summary
public long[] executeLargeBatch() throws SQLException

Redeclares as abstract: java.sql.Statement.executeLargeBatch.

Doc from java.sql.Statement.executeLargeBatch.

Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. The long elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeLargeBatch may be one of the following:

  1. A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
  2. A value of SUCCESS_NO_INFO -- indicates that the command was processed successfully but that the number of rows affected is unknown

    If one of the commands in a batch update fails to execute properly, this method throws a BatchUpdateException, and a JDBC driver may or may not continue to process the remaining commands in the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to process commands or never continuing to process commands. If the driver continues processing after a failure, the array returned by the method BatchUpdateException.getLargeUpdateCounts will contain as many elements as there are commands in the batch, and at least one of the elements will be the following:

  3. A value of EXECUTE_FAILED -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails

This method should be used when the returned row count may exceed Integer#MAX_VALUE.

The default implementation will throw UnsupportedOperationException

Returns:long[]

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.

Exceptions
SQLException:
if a database access error occurs, this method is called on a closed Statement or the driver does not support batch statements. Throws BatchUpdateException (a subclass of SQLException) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
executeLargeUpdateback to summary
public long executeLargeUpdate(String sql) throws SQLException

Redeclares as abstract: java.sql.Statement.executeLargeUpdate.

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

This method should be used when the returned row count may exceed Integer#MAX_VALUE.

Note

This method cannot be called on a PreparedStatement or CallableStatement.

The default implementation will throw UnsupportedOperationException

Parameters
sql: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.

Returns:long

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Exceptions
SQLException:
if a database access error occurs, this method is called on a closed Statement, the given SQL statement produces a ResultSet object, the method is called on a PreparedStatement or CallableStatement
executeLargeUpdateback to summary
public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException

Redeclares as abstract: java.sql.Statement.executeLargeUpdate.

Doc from java.sql.Statement.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. The driver will ignore the flag if the SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

This method should be used when the returned row count may exceed Integer#MAX_VALUE.

Note

This method cannot be called on a PreparedStatement or CallableStatement.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
sql: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.

autoGeneratedKeys: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

Returns:long

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Exceptions
SQLException:
if a database access error occurs, this method is called on a closed Statement, the given SQL statement returns a ResultSet object, the given constant is not one of those allowed, the method is called on a PreparedStatement or CallableStatement
executeLargeUpdateback to summary
public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException

Redeclares as abstract: java.sql.Statement.executeLargeUpdate.

Doc from java.sql.Statement.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. 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 SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

This method should be used when the returned row count may exceed Integer#MAX_VALUE.

Note

This method cannot be called on a PreparedStatement or CallableStatement.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
sql: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.

columnIndexes:int[]

an array of column indexes indicating the columns that should be returned from the inserted row

Returns:long

either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

Exceptions
SQLException:
if a database access error occurs, this method is called on a closed Statement, the SQL statement returns a ResultSet object,the second argument supplied to this method is not an int array whose elements are valid column indexes, the method is called on a PreparedStatement or CallableStatement
executeLargeUpdateback to summary
public long executeLargeUpdate(String sql, String[] columnNames) throws SQLException

Redeclares as abstract: java.sql.Statement.executeLargeUpdate.

Doc from java.sql.Statement.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. 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 SQL statement is not an INSERT statement, or an SQL statement able to return auto-generated keys (the list of such statements is vendor-specific).

This method should be used when the returned row count may exceed Integer#MAX_VALUE.

Note

This method cannot be called on a PreparedStatement or CallableStatement.

The default implementation will throw SQLFeatureNotSupportedException

Parameters
sql: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.

columnNames:String[]

an array of the names of the columns that should be returned from the inserted row

Returns:long

either the row count for INSERT, UPDATE, or DELETE statements, or 0 for SQL statements that return nothing

Exceptions
SQLException:
if a database access error occurs, this method is called on a closed Statement, the SQL statement returns a ResultSet object, the second argument supplied to this method is not a String array whose elements are valid column names, the method is called on a PreparedStatement or CallableStatement
getLargeMaxRowsback to summary
public long getLargeMaxRows() throws SQLException

Redeclares as abstract: java.sql.Statement.getLargeMaxRows.

Doc from java.sql.Statement.getLargeMaxRows.

Retrieves the maximum number of rows that a ResultSet object produced by this Statement object can contain. If this limit is exceeded, the excess rows are silently dropped.

This method should be used when the returned row limit may exceed Integer#MAX_VALUE.

The default implementation will return 0

Returns:long

the current maximum number of rows for a ResultSet object produced by this Statement object; zero means there is no limit

Exceptions
SQLException:
if a database access error occurs or this method is called on a closed Statement
getLargeUpdateCountback to summary
public long getLargeUpdateCount() throws SQLException

Redeclares as abstract: java.sql.Statement.getLargeUpdateCount.

Doc from java.sql.Statement.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. This method should be called only once per result.

This method should be used when the returned row count may exceed Integer#MAX_VALUE.

The default implementation will throw UnsupportedOperationException

Returns:long

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

Exceptions
SQLException:
if a database access error occurs or this method is called on a closed Statement
isCloseOnCompletionback to summary
public boolean isCloseOnCompletion() throws SQLException

Redeclares java.sql.Statement.isCloseOnCompletion.

Doc from java.sql.Statement.isCloseOnCompletion.

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

Returns:boolean

true if the Statement will be closed when all of its dependent result sets are closed; false otherwise

Exceptions
SQLException:
if this method is called on a closed Statement
setLargeMaxRowsback to summary
public void setLargeMaxRows(long max) throws SQLException

Redeclares as abstract: java.sql.Statement.setLargeMaxRows.

Doc from java.sql.Statement.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. If the limit is exceeded, the excess rows are silently dropped.

This method should be used when the row limit may exceed Integer#MAX_VALUE.

The default implementation will throw UnsupportedOperationException

Parameters
max:long

the new max rows limit; zero means there is no limit

Exceptions
SQLException:
if a database access error occurs, this method is called on a closed Statement or the condition max >= 0 is not satisfied