| java.lang.Object org.h2.message.TraceObject org.h2.jdbc.JdbcStatement
All known Subclasses: org.h2.jdbc.JdbcPreparedStatement,
Method Summary | |
public void | addBatch(String sql) Adds a statement to the batch. | public void | cancel() [Partially supported] Cancels a currently running statement. | void | checkClosed() | public void | clearBatch() Clears the batch. | public void | clearWarnings() Clears all warnings. | public void | close() Closes this statement. | void | closeOld() | public boolean | execute(String sql) Executes an arbitrary statement. | public boolean | execute(String sql, int autoGeneratedKeys) Executes a statement and returns the update count. | public boolean | execute(String sql, int[] columnIndexes) Executes a statement and returns the update count. | public boolean | execute(String sql, String[] columnNames) Executes a statement and returns the update count. | public int[] | executeBatch() Executes the batch. | public ResultSet | executeQuery(String sql) Executes a query (select statement) and returns the result set. | public int | executeUpdate(String sql) Executes a statement (insert, update, delete, create, drop)
and returns the update count. | public int | executeUpdate(String sql, int autoGeneratedKeys) Executes a statement and returns the update count. | public int | executeUpdate(String sql, int[] columnIndexes) Executes a statement and returns the update count. | public int | executeUpdate(String sql, String[] columnNames) Executes a statement and returns the update count. | public Connection | getConnection() Returns the connection that created this object. | public int | getFetchDirection() Gets the fetch direction. | public int | getFetchSize() Gets the number of rows suggested to read in one step. | public ResultSet | getGeneratedKeys() Return a result set that contains the last generated autoincrement key
for this connection. | public int | getMaxFieldSize() Gets the maximum number of bytes for a result set column. | public int | getMaxRows() Gets the maximum number of rows for a ResultSet. | public boolean | getMoreResults() Moves to the next result set - however there is always only one result
set. | public boolean | getMoreResults(int current) | public int | getQueryTimeout() Gets the current query timeout in seconds. | public ResultSet | getResultSet() Returns the last result set produces by this statement. | public int | getResultSetConcurrency() Gets the result set concurrency created by this object. | public int | getResultSetHoldability() Gets the result set holdability. | public int | getResultSetType() Gets the result set type. | public int | getUpdateCount() Returns the last update count of this statement. | public SQLWarning | getWarnings() Gets the first warning reported by calls on this object. | public boolean | isClosed() Returns whether this statement is closed. | public boolean | isPoolable() Returns whether this object is poolable. | public void | setCursorName(String name) Sets the name of the cursor. | public void | setEscapeProcessing(boolean enable) Enables or disables processing or JDBC escape syntax. | protected void | setExecutingStatement(CommandInterface c) | public void | setFetchDirection(int direction) Sets the fetch direction. | public void | setFetchSize(int rows) Sets the number of rows suggested to read in one step.
This value cannot be higher than the maximum rows (setMaxRows)
set by the statement or prepared statement, otherwise an exception
is throws. | public void | setMaxFieldSize(int max) Sets the maximum number of bytes for a result set column. | public void | setMaxRows(int maxRows) Gets the maximum number of rows for a ResultSet. | public void | setPoolable(boolean poolable) Requests that this object should be pooled or not. | public void | setQueryTimeout(int seconds) Sets the current query timeout in seconds. | public String | toString() |
closedByResultSet | protected boolean closedByResultSet(Code) | | |
escapeProcessing | protected boolean escapeProcessing(Code) | | |
fetchSize | protected int fetchSize(Code) | | |
maxRows | protected int maxRows(Code) | | |
resultSetType | protected int resultSetType(Code) | | |
updateCount | protected int updateCount(Code) | | |
cancel | public void cancel() throws SQLException(Code) | | [Partially supported] Cancels a currently running statement.
This method must be called from within another
thread than the execute method.
This method is not supported in the server mode.
throws: SQLException - if this object is closed |
clearWarnings | public void clearWarnings() throws SQLException(Code) | | Clears all warnings. As this driver does not support warnings,
this call is ignored.
|
close | public void close() throws SQLException(Code) | | Closes this statement.
All result sets that where created by this statement
become invalid after calling this method.
|
execute | public boolean execute(String sql) throws SQLException(Code) | | Executes an arbitrary statement. If another result set exists for this
statement, this will be closed (even if this statement fails).
If the statement is a create or drop and does not throw an exception, the
current transaction (if any) is committed after executing the statement.
If auto commit is on, and the statement is not a select, this statement
will be committed.
true if a result set is available, false if not |
execute | public boolean execute(String sql, int autoGeneratedKeys) throws SQLException(Code) | | Executes a statement and returns the update count.
This method just calls execute(String sql).
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
execute | public boolean execute(String sql, int[] columnIndexes) throws SQLException(Code) | | Executes a statement and returns the update count.
This method just calls execute(String sql).
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
execute | public boolean execute(String sql, String[] columnNames) throws SQLException(Code) | | Executes a statement and returns the update count.
This method just calls execute(String sql).
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
executeBatch | public int[] executeBatch() throws SQLException(Code) | | Executes the batch.
the array of update counts |
executeQuery | public ResultSet executeQuery(String sql) throws SQLException(Code) | | Executes a query (select statement) and returns the result set.
If another result set exists for this statement, this will be closed
(even if this statement fails).
the result set |
executeUpdate | public int executeUpdate(String sql) throws SQLException(Code) | | Executes a statement (insert, update, delete, create, drop)
and returns the update count.
If another result set exists for this statement, this will be closed
(even if this statement fails).
If the statement is a create or drop and does not throw an exception,
the current transaction (if any) is committed after executing the statement.
If auto commit is on, this statement will be committed.
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
executeUpdate | public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException(Code) | | Executes a statement and returns the update count.
This method just calls executeUpdate(String sql).
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
executeUpdate | public int executeUpdate(String sql, int[] columnIndexes) throws SQLException(Code) | | Executes a statement and returns the update count.
This method just calls executeUpdate(String sql).
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
executeUpdate | public int executeUpdate(String sql, String[] columnNames) throws SQLException(Code) | | Executes a statement and returns the update count.
This method just calls executeUpdate(String sql).
Parameters: sql - the SQL statement the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback) throws: SQLException - if a database error occurred or aselect statement was executed |
getFetchDirection | public int getFetchDirection() throws SQLException(Code) | | Gets the fetch direction.
FETCH_FORWARD throws: SQLException - if this object is closed |
getFetchSize | public int getFetchSize() throws SQLException(Code) | | Gets the number of rows suggested to read in one step.
the current fetch size throws: SQLException - if this object is closed |
getGeneratedKeys | public ResultSet getGeneratedKeys() throws SQLException(Code) | | Return a result set that contains the last generated autoincrement key
for this connection.
the result set with one row and one column containing the key throws: SQLException - if this object is closed |
getMaxFieldSize | public int getMaxFieldSize() throws SQLException(Code) | | Gets the maximum number of bytes for a result set column.
always 0 for no limit throws: SQLException - if this object is closed |
getMaxRows | public int getMaxRows() throws SQLException(Code) | | Gets the maximum number of rows for a ResultSet.
the number of rows where 0 means no limit throws: SQLException - if this object is closed |
getMoreResults | public boolean getMoreResults() throws SQLException(Code) | | Moves to the next result set - however there is always only one result
set. This call also closes the current result set (if there is one).
Returns true if there is a next result set (that means - it always
returns false).
false throws: SQLException - if this object is closed. |
getMoreResults | public boolean getMoreResults(int current) throws SQLException(Code) | | [Not supported]
|
getQueryTimeout | public int getQueryTimeout() throws SQLException(Code) | | Gets the current query timeout in seconds.
This method will return 0 if no query timeout is set.
The result is rounded to the next second.
the timeout in seconds throws: SQLException - if this object is closed |
getResultSet | public ResultSet getResultSet() throws SQLException(Code) | | Returns the last result set produces by this statement.
the result set |
getResultSetConcurrency | public int getResultSetConcurrency() throws SQLException(Code) | | Gets the result set concurrency created by this object.
ResultSet.CONCUR_UPDATABLE throws: SQLException - if this object is closed |
getResultSetHoldability | public int getResultSetHoldability() throws SQLException(Code) | | Gets the result set holdability.
the holdability |
getResultSetType | public int getResultSetType() throws SQLException(Code) | | Gets the result set type.
the type throws: SQLException - if this object is closed |
getUpdateCount | public int getUpdateCount() throws SQLException(Code) | | Returns the last update count of this statement.
the update count (number of row affected by an insert,update or delete, or 0 if no rows or the statement was acreate, drop, commit or rollback; -1 if the statement was a select). throws: SQLException - if this object is closed or invalid |
getWarnings | public SQLWarning getWarnings() throws SQLException(Code) | | Gets the first warning reported by calls on this object.
This driver does not support warnings, and will always return null.
null |
isClosed | public boolean isClosed() throws SQLException(Code) | | Returns whether this statement is closed.
true if the statement is closed |
isPoolable | public boolean isPoolable() throws SQLException(Code) | | Returns whether this object is poolable.
false |
setCursorName | public void setCursorName(String name) throws SQLException(Code) | | Sets the name of the cursor. This call is ignored.
Parameters: name - ignored throws: SQLException - if this object is closed |
setEscapeProcessing | public void setEscapeProcessing(boolean enable) throws SQLException(Code) | | Enables or disables processing or JDBC escape syntax.
See also Connection.nativeSQL.
Parameters: enable - - true (default) or false (no conversion is attempted) throws: SQLException - if this object is closed |
setFetchDirection | public void setFetchDirection(int direction) throws SQLException(Code) | | Sets the fetch direction.
This call is ignored by this driver.
Parameters: direction - ignored throws: SQLException - if this object is closed |
setFetchSize | public void setFetchSize(int rows) throws SQLException(Code) | | Sets the number of rows suggested to read in one step.
This value cannot be higher than the maximum rows (setMaxRows)
set by the statement or prepared statement, otherwise an exception
is throws. Setting the value to 0 will set the default value.
The default value can be changed using the system property
h2.serverResultSetFetchSize.
Parameters: rows - the number of rows throws: SQLException - if this object is closed |
setMaxFieldSize | public void setMaxFieldSize(int max) throws SQLException(Code) | | Sets the maximum number of bytes for a result set column.
This method does currently do nothing for this driver.
Parameters: max - the maximum size - ignored throws: SQLException - if this object is closed |
setMaxRows | public void setMaxRows(int maxRows) throws SQLException(Code) | | Gets the maximum number of rows for a ResultSet.
Parameters: maxRows - the number of rows where 0 means no limit throws: SQLException - if this object is closed |
setPoolable | public void setPoolable(boolean poolable) throws SQLException(Code) | | Requests that this object should be pooled or not.
This call is ignored.
Parameters: poolable - the requested value |
setQueryTimeout | public void setQueryTimeout(int seconds) throws SQLException(Code) | | Sets the current query timeout in seconds. Calling this method will
commit an open transaction, even if the value is the same as before.
Changing the value will affect all statements of this connection.
Parameters: seconds - the timeout in seconds - 0 means no timeout, valuessmaller 0 will throw an exception throws: SQLException - if this object is closed |
Fields inherited from org.h2.message.TraceObject | final public static int CALLABLE_STATEMENTCONNECTIONDATABASE_META_DATAPREPARED_STATEMENTRESULT_SETRESULT_SET_META_DATASAVEPOINTSQL_EXCEPTIONSTATEMENTBLOBCLOBPARAMETER_META_DATA(Code)(Java Doc) final public static int DATA_SOURCEXA_DATA_SOURCEXIDARRAY(Code)(Java Doc)
|
|
|