|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.h2.message.TraceObject
org.h2.jdbc.JdbcStatement
public class JdbcStatement
Represents a statement.
| Field Summary | |
|---|---|
protected boolean |
closedByResultSet
|
protected JdbcConnection |
conn
|
protected int |
fetchSize
|
protected int |
maxRows
|
protected JdbcResultSet |
resultSet
|
protected int |
resultSetConcurrency
|
protected int |
resultSetType
|
protected SessionInterface |
session
|
protected int |
updateCount
|
| Fields inherited from class org.h2.message.TraceObject |
|---|
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQL_EXCEPTION, STATEMENT, trace, XA_DATA_SOURCE, XA_RESOURCE, XID |
| Fields inherited from interface java.sql.Statement |
|---|
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
| Method Summary | |
|---|---|
void |
addBatch(java.lang.String sql)
Adds a statement to the batch. |
void |
cancel()
Cancels a currently running statement. |
protected boolean |
checkClosed(boolean write)
INTERNAL. |
void |
clearBatch()
Clears the batch. |
void |
clearWarnings()
Clears all warnings. |
void |
close()
Closes this statement. |
protected void |
closeOldResultSet()
INTERNAL. |
boolean |
execute(java.lang.String sql)
Executes an arbitrary statement. |
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
Executes a statement and returns the update count. |
boolean |
execute(java.lang.String sql,
int[] columnIndexes)
Executes a statement and returns the update count. |
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames)
Executes a statement and returns the update count. |
int[] |
executeBatch()
Executes the batch. |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Executes a query (select statement) and returns the result set. |
int |
executeUpdate(java.lang.String sql)
Executes a statement (insert, update, delete, create, drop) and returns the update count. |
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
Executes a statement and returns the update count. |
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes)
Executes a statement and returns the update count. |
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
Executes a statement and returns the update count. |
java.sql.Connection |
getConnection()
Returns the connection that created this object. |
int |
getFetchDirection()
Gets the fetch direction. |
int |
getFetchSize()
Gets the number of rows suggested to read in one step. |
java.sql.ResultSet |
getGeneratedKeys()
Return a result set that contains the last generated auto-increment key for this connection, if there was one. |
int |
getLastExecutedCommandType()
INTERNAL. |
int |
getMaxFieldSize()
Gets the maximum number of bytes for a result set column. |
int |
getMaxRows()
Gets the maximum number of rows for a ResultSet. |
boolean |
getMoreResults()
Moves to the next result set - however there is always only one result set. |
boolean |
getMoreResults(int current)
Move to the next result set. |
int |
getQueryTimeout()
Gets the current query timeout in seconds. |
java.sql.ResultSet |
getResultSet()
Returns the last result set produces by this statement. |
int |
getResultSetConcurrency()
Gets the result set concurrency created by this object. |
int |
getResultSetHoldability()
Gets the result set holdability. |
int |
getResultSetType()
Gets the result set type. |
int |
getUpdateCount()
Returns the last update count of this statement. |
java.sql.SQLWarning |
getWarnings()
Gets the first warning reported by calls on this object. |
boolean |
isClosed()
Returns whether this statement is closed. |
boolean |
isPoolable()
Returns whether this object is poolable. |
void |
setCursorName(java.lang.String name)
Sets the name of the cursor. |
void |
setEscapeProcessing(boolean enable)
Enables or disables processing or JDBC escape syntax. |
protected void |
setExecutingStatement(CommandInterface c)
INTERNAL. |
void |
setFetchDirection(int direction)
Sets the fetch direction. |
void |
setFetchSize(int rows)
Sets the number of rows suggested to read in one step. |
void |
setMaxFieldSize(int max)
Sets the maximum number of bytes for a result set column. |
void |
setMaxRows(int maxRows)
Gets the maximum number of rows for a ResultSet. |
void |
setPoolable(boolean poolable)
Requests that this object should be pooled or not. |
void |
setQueryTimeout(int seconds)
Sets the current query timeout in seconds. |
java.lang.String |
toString()
INTERNAL |
| Methods inherited from class org.h2.message.TraceObject |
|---|
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTrace, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected JdbcConnection conn
protected SessionInterface session
protected JdbcResultSet resultSet
protected int maxRows
protected int fetchSize
protected int updateCount
protected final int resultSetType
protected final int resultSetConcurrency
protected boolean closedByResultSet
| Method Detail |
|---|
public java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
executeQuery in interface java.sql.Statementsql - the SQL statement to execute
java.sql.SQLException
public int executeUpdate(java.lang.String sql)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementsql - the SQL statement
java.sql.SQLException - if a database error occurred or a
select statement was executed
public boolean execute(java.lang.String sql)
throws java.sql.SQLException
execute in interface java.sql.Statementsql - the SQL statement to execute
java.sql.SQLException
public java.sql.ResultSet getResultSet()
throws java.sql.SQLException
getResultSet in interface java.sql.Statementjava.sql.SQLException
public int getUpdateCount()
throws java.sql.SQLException
getUpdateCount in interface java.sql.Statementjava.sql.SQLException - if this object is closed or invalid
public void close()
throws java.sql.SQLException
close in interface java.sql.Statementjava.sql.SQLExceptionpublic java.sql.Connection getConnection()
getConnection in interface java.sql.Statement
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Statementjava.sql.SQLException
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Statementjava.sql.SQLException
public boolean getMoreResults()
throws java.sql.SQLException
getMoreResults in interface java.sql.Statementjava.sql.SQLException - if this object is closed.
public void setCursorName(java.lang.String name)
throws java.sql.SQLException
setCursorName in interface java.sql.Statementname - ignored
java.sql.SQLException - if this object is closed
public void setFetchDirection(int direction)
throws java.sql.SQLException
setFetchDirection in interface java.sql.Statementdirection - ignored
java.sql.SQLException - if this object is closed
public int getFetchDirection()
throws java.sql.SQLException
getFetchDirection in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public int getMaxRows()
throws java.sql.SQLException
getMaxRows in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public void setMaxRows(int maxRows)
throws java.sql.SQLException
setMaxRows in interface java.sql.StatementmaxRows - the number of rows where 0 means no limit
java.sql.SQLException - if this object is closed
public void setFetchSize(int rows)
throws java.sql.SQLException
setFetchSize in interface java.sql.Statementrows - the number of rows
java.sql.SQLException - if this object is closed
public int getFetchSize()
throws java.sql.SQLException
getFetchSize in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public int getResultSetConcurrency()
throws java.sql.SQLException
getResultSetConcurrency in interface java.sql.Statementjava.sql.SQLException
public int getResultSetType()
throws java.sql.SQLException
getResultSetType in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public int getMaxFieldSize()
throws java.sql.SQLException
getMaxFieldSize in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public void setMaxFieldSize(int max)
throws java.sql.SQLException
setMaxFieldSize in interface java.sql.Statementmax - the maximum size - ignored
java.sql.SQLException - if this object is closed
public void setEscapeProcessing(boolean enable)
throws java.sql.SQLException
setEscapeProcessing in interface java.sql.Statementenable - - true (default) or false (no conversion is attempted)
java.sql.SQLException - if this object is closed
public void cancel()
throws java.sql.SQLException
cancel in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public int getQueryTimeout()
throws java.sql.SQLException
getQueryTimeout in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public void setQueryTimeout(int seconds)
throws java.sql.SQLException
setQueryTimeout in interface java.sql.Statementseconds - the timeout in seconds - 0 means no timeout, values
smaller 0 will throw an exception
java.sql.SQLException - if this object is closed
public void addBatch(java.lang.String sql)
throws java.sql.SQLException
addBatch in interface java.sql.Statementsql - the SQL statement
java.sql.SQLException
public void clearBatch()
throws java.sql.SQLException
clearBatch in interface java.sql.Statementjava.sql.SQLException
public int[] executeBatch()
throws java.sql.SQLException
executeBatch in interface java.sql.Statementjava.sql.SQLException
public java.sql.ResultSet getGeneratedKeys()
throws java.sql.SQLException
getGeneratedKeys in interface java.sql.Statementjava.sql.SQLException - if this object is closed
public boolean getMoreResults(int current)
throws java.sql.SQLException
getMoreResults in interface java.sql.Statementcurrent - Statement.CLOSE_CURRENT_RESULT,
Statement.KEEP_CURRENT_RESULT,
or Statement.CLOSE_ALL_RESULTS
java.sql.SQLException
public int executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementsql - the SQL statementautoGeneratedKeys - ignored
java.sql.SQLException - if a database error occurred or a
select statement was executed
public int executeUpdate(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementsql - the SQL statementcolumnIndexes - ignored
java.sql.SQLException - if a database error occurred or a
select statement was executed
public int executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementsql - the SQL statementcolumnNames - ignored
java.sql.SQLException - if a database error occurred or a
select statement was executed
public boolean execute(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
execute in interface java.sql.Statementsql - the SQL statementautoGeneratedKeys - ignored
java.sql.SQLException - if a database error occurred or a
select statement was executed
public boolean execute(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
execute in interface java.sql.Statementsql - the SQL statementcolumnIndexes - ignored
java.sql.SQLException - if a database error occurred or a
select statement was executed
public boolean execute(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
execute in interface java.sql.Statementsql - the SQL statementcolumnNames - ignored
java.sql.SQLException - if a database error occurred or a
select statement was executed
public int getResultSetHoldability()
throws java.sql.SQLException
getResultSetHoldability in interface java.sql.Statementjava.sql.SQLExceptionprotected boolean checkClosed(boolean write)
write - if the next operation is possibly writing
DbException - if it is closed
protected void closeOldResultSet()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void setExecutingStatement(CommandInterface c)
c - the commandpublic int getLastExecutedCommandType()
public boolean isClosed()
throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean isPoolable()
public void setPoolable(boolean poolable)
poolable - the requested valuepublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||