|
||||||||
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, XA_DATA_SOURCE, 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 autoincrement key for this connection. |
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, setTrace, toString, 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.Statement
sql
- the SQL statement to execute
java.sql.SQLException
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic boolean execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface java.sql.Statement
sql
- the SQL statement to execute
java.sql.SQLException
public java.sql.ResultSet getResultSet() throws java.sql.SQLException
getResultSet
in interface java.sql.Statement
java.sql.SQLException
public int getUpdateCount() throws java.sql.SQLException
getUpdateCount
in interface java.sql.Statement
java.sql.SQLException
- if this object is closed or invalidpublic void close() throws java.sql.SQLException
close
in interface java.sql.Statement
java.sql.SQLException
public java.sql.Connection getConnection()
getConnection
in interface java.sql.Statement
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Statement
java.sql.SQLException
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Statement
java.sql.SQLException
public boolean getMoreResults() throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
java.sql.SQLException
- if this object is closed.public void setCursorName(java.lang.String name) throws java.sql.SQLException
setCursorName
in interface java.sql.Statement
name
- ignored
java.sql.SQLException
- if this object is closedpublic void setFetchDirection(int direction) throws java.sql.SQLException
setFetchDirection
in interface java.sql.Statement
direction
- ignored
java.sql.SQLException
- if this object is closedpublic int getFetchDirection() throws java.sql.SQLException
getFetchDirection
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic int getMaxRows() throws java.sql.SQLException
getMaxRows
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic void setMaxRows(int maxRows) throws java.sql.SQLException
setMaxRows
in interface java.sql.Statement
maxRows
- the number of rows where 0 means no limit
java.sql.SQLException
- if this object is closedpublic void setFetchSize(int rows) throws java.sql.SQLException
setFetchSize
in interface java.sql.Statement
rows
- the number of rows
java.sql.SQLException
- if this object is closedpublic int getFetchSize() throws java.sql.SQLException
getFetchSize
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic int getResultSetConcurrency() throws java.sql.SQLException
getResultSetConcurrency
in interface java.sql.Statement
java.sql.SQLException
public int getResultSetType() throws java.sql.SQLException
getResultSetType
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic int getMaxFieldSize() throws java.sql.SQLException
getMaxFieldSize
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic void setMaxFieldSize(int max) throws java.sql.SQLException
setMaxFieldSize
in interface java.sql.Statement
max
- the maximum size - ignored
java.sql.SQLException
- if this object is closedpublic void setEscapeProcessing(boolean enable) throws java.sql.SQLException
setEscapeProcessing
in interface java.sql.Statement
enable
- - true (default) or false (no conversion is attempted)
java.sql.SQLException
- if this object is closedpublic void cancel() throws java.sql.SQLException
cancel
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic int getQueryTimeout() throws java.sql.SQLException
getQueryTimeout
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic void setQueryTimeout(int seconds) throws java.sql.SQLException
setQueryTimeout
in interface java.sql.Statement
seconds
- the timeout in seconds - 0 means no timeout, values
smaller 0 will throw an exception
java.sql.SQLException
- if this object is closedpublic void addBatch(java.lang.String sql) throws java.sql.SQLException
addBatch
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
public void clearBatch() throws java.sql.SQLException
clearBatch
in interface java.sql.Statement
java.sql.SQLException
public int[] executeBatch() throws java.sql.SQLException
executeBatch
in interface java.sql.Statement
java.sql.SQLException
public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
getGeneratedKeys
in interface java.sql.Statement
java.sql.SQLException
- if this object is closedpublic boolean getMoreResults(int current) throws java.sql.SQLException
getMoreResults
in interface java.sql.Statement
current
- 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.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic int executeUpdate(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic int executeUpdate(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
executeUpdate
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic boolean execute(java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
execute
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic boolean execute(java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
execute
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic boolean execute(java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
execute
in interface java.sql.Statement
sql
- the SQL statement
java.sql.SQLException
- if a database error occurred or a
select statement was executedpublic int getResultSetHoldability() throws java.sql.SQLException
getResultSetHoldability
in interface java.sql.Statement
java.sql.SQLException
protected boolean checkClosed(boolean write) throws java.sql.SQLException
write
- if the next operation is possibly writing
java.sql.SQLException
- if it is closedprotected void closeOldResultSet() throws java.sql.SQLException
java.sql.SQLException
protected void setExecutingStatement(CommandInterface c)
c
- the commandpublic boolean isClosed() throws java.sql.SQLException
java.sql.SQLException
public 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 |