Class EmbedStatement
- java.lang.Object
-
- org.apache.derby.impl.jdbc.EmbedStatement
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, java.sql.Statement, java.sql.Wrapper, EngineStatement
- Direct Known Subclasses:
- EmbedPreparedStatement
public class EmbedStatement extends java.lang.Object implements EngineStatement
EmbedStatement is a local JDBC statement. It supports JDBC 4.1.
-
-
Constructor Summary
Constructors Constructor and Description EmbedStatement(EmbedConnection connection, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddBatch(java.lang.String sql)JDBC 2.0 Adds a SQL command to the current batch of commmands for the statement.voidcancel()Cancel can be used by one thread to cancel a statement that is being executed by another thread.voidclearBatch()JDBC 2.0 Make the set of commands in the current batch empty.voidclearWarnings()After this call getWarnings returns null until a new warning is reported for this Statement.voidclose()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.voidcloseOnCompletion()booleanexecute(java.lang.String sql)Execute a SQL statement that may return multiple results.booleanexecute(java.lang.String sql, int autoGeneratedKeys)JDBC 3.0 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.booleanexecute(java.lang.String sql, int[] columnIndexes)JDBC 3.0 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.booleanexecute(java.lang.String sql, java.lang.String[] columnNames)JDBC 3.0 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.int[]executeBatch()JDBC 2.0 Submit a batch of commands to the database for execution.long[]executeLargeBatch()JDBC 4.2 Submit a batch of commands to the database for execution.longexecuteLargeUpdate(java.lang.String sql)JDBC 4.2 Execute a SQL INSERT, UPDATE or DELETE statement.longexecuteLargeUpdate(java.lang.String sql, int autoGeneratedKeys)JDBC 4.2 Execute 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.longexecuteLargeUpdate(java.lang.String sql, int[] columnIndexes)JDBC 4.2 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.longexecuteLargeUpdate(java.lang.String sql, java.lang.String[] columnNames)JDBC 4.2 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.java.sql.ResultSetexecuteQuery(java.lang.String sql)Execute a SQL statement that returns a single ResultSet.intexecuteUpdate(java.lang.String sql)Execute a SQL INSERT, UPDATE or DELETE statement.intexecuteUpdate(java.lang.String sql, int autoGeneratedKeys)JDBC 3.0 Execute 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.intexecuteUpdate(java.lang.String sql, int[] columnIndexes)JDBC 3.0 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.intexecuteUpdate(java.lang.String sql, java.lang.String[] columnNames)JDBC 3.0 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.java.sql.ConnectiongetConnection()JDBC 2.0 Return the Connection that produced the Statement.intgetFetchDirection()JDBC 2.0 Determine the fetch direction.intgetFetchSize()JDBC 2.0 Determine the default fetch size.java.sql.ResultSetgetGeneratedKeys()JDBC 3.0 Retrieves any auto-generated keys created as a result of executing this Statement object.longgetLargeMaxRows()JDBC 4.2 The maxRows limit is the maximum number of rows that a ResultSet can contain.longgetLargeUpdateCount()JDBC 4.2 getLargeUpdateCount returns the current result as an update count; if the result is a ResultSet or there are no more results -1 is returned.intgetMaxFieldSize()The maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns.intgetMaxRows()The maxRows limit is the maximum number of rows that a ResultSet can contain.booleangetMoreResults()getMoreResults moves to a Statement's next result.booleangetMoreResults(int current)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 objectParameterValueSetgetParameterValueSet()intgetQueryTimeout()The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.java.sql.ResultSetgetResultSet()getResultSet returns the current result as a ResultSet.intgetResultSetConcurrency()JDBC 2.0 Determine the result set concurrency.intgetResultSetHoldability()JDBC 3.0 Retrieves the result set holdability for ResultSet objects generated by this Statement object.intgetResultSetType()JDBC 2.0 Determine the result set type.java.lang.StringgetSQLText()intgetUpdateCount()getUpdateCount returns the current result as an update count; if the result is a ResultSet or there are no more results -1 is returned.java.sql.SQLWarninggetWarnings()The first warning reported by calls on this Statement is returned.booleanisClosed()Tell whether this statment has been closed or not.booleanisCloseOnCompletion()booleanisPoolable()Returns the value of the EmbedStatement's poolable hint, indicating whether pooling is requested.booleanisWrapperFor(java.lang.Class<?> interfaces)Returns false unlessinterfacesis implemented.voidsetApplicationStatement(EngineStatement s)Set the application statement for this Statement.voidsetCursorName(java.lang.String name)setCursorName defines the SQL cursor name that will be used by subsequent Statement execute methods.voidsetEscapeProcessing(boolean enable)If escape scanning is on (the default) the driver will do escape substitution before sending the SQL to the database.voidsetFetchDirection(int direction)JDBC 2.0 Give a hint as to the direction in which the rows in a result set will be processed.voidsetFetchSize(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.voidsetLargeMaxRows(long max)The maxRows limit is set to limit the number of rows that any ResultSet can contain.voidsetMaxFieldSize(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.voidsetMaxRows(int max)The maxRows limit is set to limit the number of rows that any ResultSet can contain.voidsetPoolable(boolean poolable)Requests that an EmbedStatement be pooled or not.voidsetQueryTimeout(int seconds)The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.voidtransferBatch(EmbedStatement other)Transfer my batch of Statements to a newly created Statement.<T> Tunwrap(java.lang.Class<T> interfaces)Returnsthisif this class implements the interface.
-
-
-
Constructor Detail
-
EmbedStatement
public EmbedStatement(EmbedConnection connection, boolean forMetaData, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
-
-
Method Detail
-
executeQuery
public java.sql.ResultSet executeQuery(java.lang.String sql) throws java.sql.SQLExceptionExecute a SQL statement that returns a single ResultSet.- Specified by:
executeQueryin interfacejava.sql.Statement- Parameters:
sql- typically this is a static SQL SELECT statement- Returns:
- a ResultSet that contains the data produced by the query; never null
- Throws:
java.sql.SQLException- thrown on failure.
-
executeUpdate
public int executeUpdate(java.lang.String sql) throws java.sql.SQLExceptionExecute a SQL INSERT, UPDATE or DELETE statement. In addition, SQL statements that return nothing such as SQL DDL statements can be executed.- Specified by:
executeUpdatein interfacejava.sql.Statement- Parameters:
sql- a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothing- Returns:
- either the row count for INSERT, UPDATE or DELETE; or 0 for SQL statements that return nothing
- Throws:
java.sql.SQLException- thrown on failure.
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql) throws java.sql.SQLExceptionJDBC 4.2 Execute a SQL INSERT, UPDATE or DELETE statement. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Specified by:
executeLargeUpdatein interfaceEngineStatement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLExceptionJDBC 3.0 Execute 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.- Specified by:
executeUpdatein interfacejava.sql.Statement- Parameters:
sql- a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothingautoGeneratedKeys- - 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:
- either the row count for INSERT, UPDATE or DELETE; or 0 for SQL statements that return nothing
- Throws:
java.sql.SQLException- if a database access error occurs
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLExceptionJDBC 4.2 Execute 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. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Specified by:
executeLargeUpdatein interfaceEngineStatement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLExceptionJDBC 3.0 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- Specified by:
executeUpdatein interfacejava.sql.Statement- Parameters:
sql- a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothingcolumnIndexes- - an array of column indexes indicating the columns that should be returned from the inserted row- Returns:
- either the row count for INSERT, UPDATE or DELETE; or 0 for SQL statements that return nothing
- Throws:
java.sql.SQLException- if a database access error occurs
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLExceptionJDBC 4.2 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. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Specified by:
executeLargeUpdatein interfaceEngineStatement- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLExceptionJDBC 3.0 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- Specified by:
executeUpdatein interfacejava.sql.Statement- Parameters:
sql- a SQL INSERT, UPDATE or DELETE statement or a SQL statement that returns nothingcolumnNames- - an array of the names of the columns that should be returned from the inserted row- Returns:
- either the row count for INSERT, UPDATE or DELETE; or 0 for SQL statements that return nothing
- Throws:
java.sql.SQLException- if a database access error occurs
-
executeLargeUpdate
public long executeLargeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLExceptionJDBC 4.2 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. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
executeLargeUpdatein interfacejava.sql.Statement- Specified by:
executeLargeUpdatein interfaceEngineStatement- Throws:
java.sql.SQLException
-
isClosed
public boolean isClosed() throws java.sql.SQLExceptionTell whether this statment has been closed or not.- Specified by:
isClosedin interfacejava.sql.Statement- Returns:
trueis closed,falseotherwise.- Throws:
java.sql.SQLException- if a database access error occurs.
-
close
public final void close() throws java.sql.SQLExceptionIn 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.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.sql.Statement- Throws:
java.sql.SQLException- thrown on failure.
-
getMaxFieldSize
public int getMaxFieldSize() throws java.sql.SQLExceptionThe maxFieldSize limit (in bytes) is the maximum amount of data returned for any column value; it only applies to BINARY, VARBINARY, LONGVARBINARY, CHAR, VARCHAR, and LONGVARCHAR columns. If the limit is exceeded, the excess data is silently discarded.- Specified by:
getMaxFieldSizein interfacejava.sql.Statement- Returns:
- the current max column size limit; zero means unlimited
- Throws:
java.sql.SQLException- thrown on failure.
-
setMaxFieldSize
public void setMaxFieldSize(int max) throws java.sql.SQLExceptionThe 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.- Specified by:
setMaxFieldSizein interfacejava.sql.Statement- Parameters:
max- the new max column size limit; zero means unlimited- Throws:
java.sql.SQLException- thrown on failure.
-
getMaxRows
public int getMaxRows() throws java.sql.SQLExceptionThe maxRows limit is the maximum number of rows that a ResultSet can contain. If the limit is exceeded, the excess rows are silently dropped.- Specified by:
getMaxRowsin interfacejava.sql.Statement- Returns:
- the current max row limit; zero means unlimited
- Throws:
java.sql.SQLException- thrown on failure.
-
getLargeMaxRows
public long getLargeMaxRows() throws java.sql.SQLExceptionJDBC 4.2 The maxRows limit is the maximum number of rows that a ResultSet can contain. If the limit is exceeded, the excess rows are silently dropped. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
getLargeMaxRowsin interfacejava.sql.Statement- Specified by:
getLargeMaxRowsin interfaceEngineStatement- Returns:
- the current max row limit; zero means unlimited
- Throws:
java.sql.SQLException- thrown on failure.
-
setMaxRows
public void setMaxRows(int max) throws java.sql.SQLExceptionThe 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.- Specified by:
setMaxRowsin interfacejava.sql.Statement- Parameters:
max- the new max rows limit; zero means unlimited- Throws:
java.sql.SQLException- thrown on failure.
-
setLargeMaxRows
public void setLargeMaxRows(long max) throws java.sql.SQLExceptionThe 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.- Specified by:
setLargeMaxRowsin interfacejava.sql.Statement- Specified by:
setLargeMaxRowsin interfaceEngineStatement- Parameters:
max- the new max rows limit; zero means unlimited- Throws:
java.sql.SQLException- thrown on failure.
-
setEscapeProcessing
public void setEscapeProcessing(boolean enable) throws java.sql.SQLExceptionIf escape scanning is on (the default) the driver will do escape substitution before sending the SQL to the database.- Specified by:
setEscapeProcessingin interfacejava.sql.Statement- Parameters:
enable- true to enable; false to disable- Throws:
java.sql.SQLException- thrown on failure.
-
getQueryTimeout
public final int getQueryTimeout() throws java.sql.SQLExceptionThe queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded a SQLException is thrown.- Specified by:
getQueryTimeoutin interfacejava.sql.Statement- Returns:
- the current query timeout limit in seconds; zero means unlimited
- Throws:
java.sql.SQLException- thrown on failure.
-
setQueryTimeout
public final void setQueryTimeout(int seconds) throws java.sql.SQLExceptionThe queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded a SQLException is thrown.- Specified by:
setQueryTimeoutin interfacejava.sql.Statement- Parameters:
seconds- the new query timeout limit in seconds; zero means unlimited- Throws:
java.sql.SQLException- thrown on failure.
-
cancel
public void cancel() throws java.sql.SQLExceptionCancel can be used by one thread to cancel a statement that is being executed by another thread.- Specified by:
cancelin interfacejava.sql.Statement- Throws:
java.sql.SQLException- thrown on failure.
-
getWarnings
public java.sql.SQLWarning getWarnings() throws java.sql.SQLExceptionThe 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.
- Specified by:
getWarningsin interfacejava.sql.Statement- Returns:
- the first SQLWarning or null
- Throws:
java.sql.SQLException- thrown on failure.
-
clearWarnings
public void clearWarnings() throws java.sql.SQLExceptionAfter this call getWarnings returns null until a new warning is reported for this Statement.- Specified by:
clearWarningsin interfacejava.sql.Statement- Throws:
java.sql.SQLException- thrown on failure.
-
setCursorName
public void setCursorName(java.lang.String name) throws java.sql.SQLExceptionsetCursorName 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 statement. 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.
- Specified by:
setCursorNamein interfacejava.sql.Statement- Parameters:
name- the new cursor name.- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql) throws java.sql.SQLExceptionExecute a SQL statement that may return multiple results. Under some (uncommon) situations a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this, unless you're executing a stored procedure that you know may return multiple results, or unless you're dynamically executing an unknown SQL string. The "execute", "getMoreResults", "getResultSet" and "getUpdateCount" methods let you navigate through multiple results. The "execute" method executes a SQL statement and indicates the form of the first result. You can then use getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).- Specified by:
executein interfacejava.sql.Statement- Parameters:
sql- any SQL statement- Returns:
- true if the first result is a ResultSet; false if it is an integer
- Throws:
java.sql.SQLException- thrown on failure- See Also:
getResultSet(),getUpdateCount(),getMoreResults()
-
execute
public boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLExceptionJDBC 3.0 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.- Specified by:
executein interfacejava.sql.Statement- Parameters:
sql- any SQL statementautoGeneratedKeys- - 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- Returns:
- rue if the first result is a ResultSet object; false if it is an update count or there are no results
- Throws:
java.sql.SQLException- if a database access error occurs
-
execute
public boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLExceptionJDBC 3.0 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.- Specified by:
executein interfacejava.sql.Statement- Parameters:
sql- any SQL statementcolumnIndexes- - 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- Returns:
- rue if the first result is a ResultSet object; false if it is an update count or there are no results
- Throws:
java.sql.SQLException- if a database access error occurs
-
execute
public boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLExceptionJDBC 3.0 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.- Specified by:
executein interfacejava.sql.Statement- Parameters:
sql- any SQL statementcolumnNames- - 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- Returns:
- rue if the first result is a ResultSet object; false if it is an update count or there are no results
- Throws:
java.sql.SQLException- if a database access error occurs
-
getResultSet
public final java.sql.ResultSet getResultSet() throws java.sql.SQLExceptiongetResultSet returns the current result as a ResultSet. It should only be called once per result.- Specified by:
getResultSetin interfacejava.sql.Statement- 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.
- Throws:
java.sql.SQLException- See Also:
execute(java.lang.String)
-
getUpdateCount
public final int getUpdateCount() throws java.sql.SQLExceptiongetUpdateCount 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.
- Specified by:
getUpdateCountin interfacejava.sql.Statement- Returns:
- the current result as an update count; -1 if it is a ResultSet or there are no more results
- Throws:
java.sql.SQLException- See Also:
execute(java.lang.String)
-
getLargeUpdateCount
public final long getLargeUpdateCount() throws java.sql.SQLExceptionJDBC 4.2 getLargeUpdateCount 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. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
getLargeUpdateCountin interfacejava.sql.Statement- Specified by:
getLargeUpdateCountin interfaceEngineStatement- Throws:
java.sql.SQLException
-
getMoreResults
public final boolean getMoreResults() throws java.sql.SQLExceptiongetMoreResults 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)- Specified by:
getMoreResultsin interfacejava.sql.Statement- Returns:
- true if the next result is a ResultSet; false if it is an update count or there are no more results
- Throws:
java.sql.SQLException- thrown on failure.- See Also:
execute(java.lang.String)
-
getResultSetType
public final int getResultSetType() throws java.sql.SQLExceptionJDBC 2.0 Determine the result set type.- Specified by:
getResultSetTypein interfacejava.sql.Statement- Throws:
java.sql.SQLException- Feature not implemented for now.
-
setFetchDirection
public void setFetchDirection(int direction) throws java.sql.SQLExceptionJDBC 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.- Specified by:
setFetchDirectionin interfacejava.sql.Statement- Parameters:
direction- the initial direction for processing rows- Throws:
java.sql.SQLException- if a database-access error occurs or direction is not one of ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWN
-
getFetchDirection
public int getFetchDirection() throws java.sql.SQLExceptionJDBC 2.0 Determine the fetch direction.- Specified by:
getFetchDirectionin interfacejava.sql.Statement- Returns:
- the default fetch direction
- Throws:
java.sql.SQLException- if a database-access error occurs
-
setFetchSize
public void setFetchSize(int rows) throws java.sql.SQLExceptionJDBC 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 statement. If the value specified is zero, then the hint is ignored. The default value is zero.- Specified by:
setFetchSizein interfacejava.sql.Statement- Parameters:
rows- the number of rows to fetch- Throws:
java.sql.SQLException- if a database-access error occurs, or the condition 0 <= rows <= this.getMaxRows() is not satisfied.
-
getFetchSize
public int getFetchSize() throws java.sql.SQLExceptionJDBC 2.0 Determine the default fetch size.- Specified by:
getFetchSizein interfacejava.sql.Statement- Throws:
java.sql.SQLException- if a database-access error occurs
-
getResultSetConcurrency
public int getResultSetConcurrency() throws java.sql.SQLExceptionJDBC 2.0 Determine the result set concurrency.- Specified by:
getResultSetConcurrencyin interfacejava.sql.Statement- Throws:
java.sql.SQLException- Feature not implemented for now.
-
getResultSetHoldability
public final int getResultSetHoldability() throws java.sql.SQLExceptionJDBC 3.0 Retrieves the result set holdability for ResultSet objects generated by this Statement object.- Specified by:
getResultSetHoldabilityin interfacejava.sql.Statement- Returns:
- either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
- Throws:
java.sql.SQLException- Feature not implemented for now.
-
addBatch
public void addBatch(java.lang.String sql) throws java.sql.SQLExceptionJDBC 2.0 Adds a SQL command to the current batch of commmands for the statement. This method is optional.- Specified by:
addBatchin interfacejava.sql.Statement- Parameters:
sql- typically this is a static SQL INSERT or UPDATE statement- Throws:
java.sql.SQLException- if a database-access error occurs, or the driver does not support batch statements
-
clearBatch
public final void clearBatch() throws java.sql.SQLExceptionJDBC 2.0 Make the set of commands in the current batch empty. This method is optional.- Specified by:
clearBatchin interfacejava.sql.Statement- Throws:
java.sql.SQLException- if a database-access error occurs, or the driver does not support batch statements
-
executeBatch
public int[] executeBatch() throws java.sql.SQLExceptionJDBC 2.0 Submit a batch of commands to the database for execution. This method is optional. Moving jdbc2.0 batch related code in this class because callableStatement in jdbc 20 needs this code too and it doesn't derive from prepared statement in jdbc 20 in our implementation. BatchUpdateException is the only new class from jdbc 20 which is being referenced here and in order to avoid any jdk11x problems, using reflection code to make an instance of that class.- Specified by:
executeBatchin interfacejava.sql.Statement- Returns:
- an array of update counts containing one element for each command in the batch. The array is ordered according to the order in which commands were inserted into the batch
- Throws:
java.sql.SQLException- if a database-access error occurs, or the driver does not support batch statements
-
executeLargeBatch
public long[] executeLargeBatch() throws java.sql.SQLExceptionJDBC 4.2 Submit a batch of commands to the database for execution. This method is optional. For use with statements which may touch more than Integer.MAX_VALUE rows.- Specified by:
executeLargeBatchin interfacejava.sql.Statement- Specified by:
executeLargeBatchin interfaceEngineStatement- Throws:
java.sql.SQLException
-
getConnection
public final java.sql.Connection getConnection() throws java.sql.SQLExceptionJDBC 2.0 Return the Connection that produced the Statement.- Specified by:
getConnectionin interfacejava.sql.Statement- Throws:
java.sql.SQLException- Exception if it cannot find the connection associated to this statement.
-
getMoreResults
public final boolean getMoreResults(int current) throws java.sql.SQLExceptionJDBC 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- Specified by:
getMoreResultsin interfacejava.sql.Statement- Parameters:
current- - 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- Returns:
- true if the next result is a ResultSet; false if it is an update count or there are no more results
- Throws:
java.sql.SQLException- thrown on failure.- See Also:
execute(java.lang.String)
-
getGeneratedKeys
public final java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLExceptionJDBC 3.0 Retrieves any auto-generated keys created as a result of executing this Statement object. If this Statement is a non-insert statement, a null ResultSet object is returned.- Specified by:
getGeneratedKeysin interfacejava.sql.Statement- Returns:
- a ResultSet object containing the auto-generated key(s) generated by the execution of this Statement object
- Throws:
java.sql.SQLException- if a database access error occurs
-
getSQLText
public java.lang.String getSQLText()
-
getParameterValueSet
public ParameterValueSet getParameterValueSet()
-
transferBatch
public void transferBatch(EmbedStatement other) throws java.sql.SQLException
Transfer my batch of Statements to a newly created Statement.- Throws:
java.sql.SQLException
-
setApplicationStatement
public final void setApplicationStatement(EngineStatement s)
Set the application statement for this Statement.
-
isPoolable
public boolean isPoolable() throws java.sql.SQLExceptionReturns the value of the EmbedStatement's poolable hint, indicating whether pooling is requested.- Specified by:
isPoolablein interfacejava.sql.Statement- Returns:
- The value of the poolable hint.
- Throws:
java.sql.SQLException- if the Statement has been closed.
-
setPoolable
public void setPoolable(boolean poolable) throws java.sql.SQLExceptionRequests that an EmbedStatement be pooled or not.- Specified by:
setPoolablein interfacejava.sql.Statement- Parameters:
poolable- requests that the EmbedStatement be pooled if true and not be pooled if false.- Throws:
java.sql.SQLException- if the EmbedStatement has been closed.
-
isWrapperFor
public final boolean isWrapperFor(java.lang.Class<?> interfaces) throws java.sql.SQLExceptionReturns false unlessinterfacesis implemented.- Specified by:
isWrapperForin interfacejava.sql.Wrapper- Parameters:
interfaces- a Class defining an interface.- Returns:
- 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.
-
unwrap
public final <T> T unwrap(java.lang.Class<T> interfaces) throws java.sql.SQLExceptionReturnsthisif this class implements the interface.- Specified by:
unwrapin interfacejava.sql.Wrapper- Parameters:
interfaces- a Class defining an interface- Returns:
- an object that implements the interface
- Throws:
java.sql.SQLException- if no object if found that implements the interface
-
closeOnCompletion
public void closeOnCompletion() throws java.sql.SQLException- Specified by:
closeOnCompletionin interfacejava.sql.Statement- Specified by:
closeOnCompletionin interfaceEngineStatement- Throws:
java.sql.SQLException
-
isCloseOnCompletion
public boolean isCloseOnCompletion() throws java.sql.SQLException- Specified by:
isCloseOnCompletionin interfacejava.sql.Statement- Specified by:
isCloseOnCompletionin interfaceEngineStatement- Throws:
java.sql.SQLException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG