StatementRepresents a statement.
void addBatch(String sql) throws SQLExceptionAdds a statement to the batch.void cancel() throws SQLExceptionCancels a currently running statement. This method must be called from within another thread than the execute method.Throws:
SQLException - if this object is closed
void clearBatch() throws SQLExceptionClears the batch.void clearWarnings() throws SQLExceptionClears all warnings. As this driver does not support warnings, this call is ignored.void close() throws SQLExceptionCloses this statement. All result sets that where created by this statement become invalid after calling this method.void closeOldResultSet() throws SQLExceptionClose and old result set if there is still one open.boolean execute(String sql) throws SQLExceptionExecutes 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.Returns:
true if a result set is available, false if not
boolean execute(String sql, int autoGeneratedKeys) throws SQLExceptionExecutes a statement and returns the update count. This method just calls execute(String sql).Parameters:
sql - the SQL statement
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
boolean execute(String sql, int[] columnIndexes) throws SQLExceptionExecutes a statement and returns the update count. This method just calls execute(String sql).Parameters:
sql - the SQL statement
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
boolean execute(String sql, String[] columnNames) throws SQLExceptionExecutes a statement and returns the update count. This method just calls execute(String sql).Parameters:
sql - the SQL statement
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
int[] executeBatch() throws SQLExceptionExecutes the batch.Returns:
the array of update counts
ResultSet executeQuery(String sql) throws SQLExceptionExecutes 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).Returns:
the result set
int executeUpdate(String sql) throws SQLExceptionExecutes 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
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
int executeUpdate(String sql, int autoGeneratedKeys) throws SQLExceptionExecutes a statement and returns the update count. This method just calls executeUpdate(String sql).Parameters:
sql - the SQL statement
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
int executeUpdate(String sql, int[] columnIndexes) throws SQLExceptionExecutes a statement and returns the update count. This method just calls executeUpdate(String sql).Parameters:
sql - the SQL statement
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
int executeUpdate(String sql, String[] columnNames) throws SQLExceptionExecutes a statement and returns the update count. This method just calls executeUpdate(String sql).Parameters:
sql - the SQL statement
Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback)
Throws:
SQLException - if a database error occurred or a
select statement was executed
Connection getConnection() throws SQLExceptionReturns the connection that created this object.Returns:
the connection
int getFetchDirection() throws SQLExceptionGets the fetch direction.Returns:
FETCH_FORWARD
Throws:
SQLException - if this object is closed
int getFetchSize() throws SQLExceptionGets the number of rows suggested to read in one step.Returns:
the current fetch size
Throws:
SQLException - if this object is closed
ResultSet getGeneratedKeys() throws SQLExceptionReturn a result set that contains the last generated autoincrement key for this connection.Returns:
the result set with one row and one column containing the key
Throws:
SQLException - if this object is closed
int getMaxFieldSize() throws SQLExceptionGets the maximum number of bytes for a result set column.Returns:
always 0 for no limit
Throws:
SQLException - if this object is closed
int getMaxRows() throws SQLExceptionGets the maximum number of rows for a ResultSet.Returns:
the number of rows where 0 means no limit
Throws:
SQLException - if this object is closed
boolean getMoreResults() throws SQLExceptionMoves 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).Returns:
false
Throws:
SQLException - if this object is closed.
boolean getMoreResults(int current) throws SQLException[Not supported]int getQueryTimeout() throws SQLExceptionGets 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.Returns:
the timeout in seconds
Throws:
SQLException - if this object is closed
ResultSet getResultSet() throws SQLExceptionReturns the last result set produces by this statement.Returns:
the result set
int getResultSetConcurrency() throws SQLExceptionGets the result set concurrency created by this object.Returns:
ResultSet.CONCUR_UPDATABLE
Throws:
SQLException - if this object is closed
int getResultSetHoldability() throws SQLExceptionGets the result set holdability.Returns:
the holdability
int getResultSetType() throws SQLExceptionGets the result set type.Returns:
the type
Throws:
SQLException - if this object is closed
int getUpdateCount() throws SQLExceptionReturns the last update count of this statement.Returns:
the update count (number of row affected by an insert,
update or delete, or 0 if no rows or the statement was a
create, drop, commit or rollback; -1 if the statement was a select).
Throws:
SQLException - if this object is closed or invalid
SQLWarning getWarnings() throws SQLExceptionGets the first warning reported by calls on this object. This driver does not support warnings, and will always return null.Returns:
null
boolean isClosed() throws SQLExceptionReturns whether this statement is closed.Returns:
true if the statement is closed
boolean isPoolable()Returns whether this object is poolable.Returns:
false
void setCursorName(String name) throws SQLExceptionSets the name of the cursor. This call is ignored.Parameters:
name - ignored
Throws:
SQLException - if this object is closed
void setEscapeProcessing(boolean enable) throws SQLExceptionEnables 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
void setExecutingStatement(CommandInterface c)void setFetchDirection(int direction) throws SQLExceptionSets the fetch direction. This call is ignored by this driver.Parameters:
direction - ignored
Throws:
SQLException - if this object is closed
void setFetchSize(int rows) throws SQLExceptionSets 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
void setMaxFieldSize(int max) throws SQLExceptionSets 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
void setMaxRows(int maxRows) throws SQLExceptionGets 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
void setPoolable(boolean poolable)Requests that this object should be pooled or not. This call is ignored.Parameters:
poolable - the requested value
void setQueryTimeout(int seconds) throws SQLExceptionSets 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. This method does not commit a transaction, and rolling back a transaction does not affect this setting.Parameters:
seconds - the timeout in seconds - 0 means no timeout, values
smaller 0 will throw an exception
Throws:
SQLException - if this object is closed
|