|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jolbox.bonecp.StatementHandle
public class StatementHandle
Wrapper around JDBC Statement.
| Field Summary | |
|---|---|
boolean |
inCache
If true, this statement is in the cache. |
java.lang.String |
openStackTrace
Stack trace capture of where this statement was opened. |
| 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 |
| Constructor Summary | |
|---|---|
StatementHandle(java.sql.Statement internalStatement,
ConnectionHandle connectionHandle,
boolean logStatementsEnabled)
Constructor for empty statement (created via connection.createStatement) |
|
StatementHandle(java.sql.Statement internalStatement,
java.lang.String sql,
IStatementCache cache,
ConnectionHandle connectionHandle,
java.lang.String cacheKey,
boolean logStatementsEnabled)
Constructor to statement handle wrapper. |
|
| Method Summary | ||
|---|---|---|
void |
addBatch(java.lang.String sql)
|
|
void |
cancel()
|
|
void |
clearBatch()
|
|
void |
clearWarnings()
|
|
void |
close()
|
|
boolean |
execute(java.lang.String sql)
|
|
boolean |
execute(java.lang.String sql,
int autoGeneratedKeys)
|
|
boolean |
execute(java.lang.String sql,
int[] columnIndexes)
|
|
boolean |
execute(java.lang.String sql,
java.lang.String[] columnNames)
|
|
int[] |
executeBatch()
|
|
java.sql.ResultSet |
executeQuery(java.lang.String sql)
|
|
int |
executeUpdate(java.lang.String sql)
|
|
int |
executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
|
|
int |
executeUpdate(java.lang.String sql,
int[] columnIndexes)
|
|
int |
executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
|
|
java.sql.Connection |
getConnection()
|
|
java.lang.Object |
getDebugHandle()
Returns the debugHandle field. |
|
int |
getFetchDirection()
|
|
int |
getFetchSize()
|
|
java.sql.ResultSet |
getGeneratedKeys()
|
|
java.sql.Statement |
getInternalStatement()
Returns the statement being wrapped around by this wrapper. |
|
int |
getMaxFieldSize()
|
|
int |
getMaxRows()
|
|
boolean |
getMoreResults()
|
|
boolean |
getMoreResults(int current)
|
|
java.lang.String |
getOpenStackTrace()
Returns the stack trace where this statement was first opened. |
|
int |
getQueryTimeout()
|
|
java.sql.ResultSet |
getResultSet()
|
|
int |
getResultSetConcurrency()
|
|
int |
getResultSetHoldability()
|
|
int |
getResultSetType()
|
|
int |
getUpdateCount()
|
|
java.sql.SQLWarning |
getWarnings()
|
|
boolean |
isClosed()
Returns true if statement is logically closed |
|
boolean |
isPoolable()
|
|
boolean |
isWrapperFor(java.lang.Class<?> iface)
|
|
void |
setCursorName(java.lang.String name)
|
|
void |
setDebugHandle(java.lang.Object debugHandle)
Sets a debugHandle, an object that is not used by the connection pool at all but may be set by an application to track this particular connection handle for any purpose it deems fit. |
|
void |
setEscapeProcessing(boolean enable)
|
|
void |
setFetchDirection(int direction)
|
|
void |
setFetchSize(int rows)
|
|
void |
setInternalStatement(java.sql.Statement internalStatement)
Sets the internal statement used by this wrapper. |
|
void |
setMaxFieldSize(int max)
|
|
void |
setMaxRows(int max)
|
|
void |
setOpenStackTrace(java.lang.String openStackTrace)
Sets the stack trace where this statement was first opened. |
|
void |
setPoolable(boolean poolable)
|
|
void |
setQueryTimeout(int seconds)
|
|
java.lang.String |
toString()
|
|
|
unwrap(java.lang.Class<T> iface)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public volatile boolean inCache
public java.lang.String openStackTrace
| Constructor Detail |
|---|
public StatementHandle(java.sql.Statement internalStatement,
java.lang.String sql,
IStatementCache cache,
ConnectionHandle connectionHandle,
java.lang.String cacheKey,
boolean logStatementsEnabled)
internalStatement - handle to actual statement instance.sql - statement used for this handle.cache - Cache handleconnectionHandle - Handle to the connectioncacheKey - logStatementsEnabled - set to true to log statements.
public StatementHandle(java.sql.Statement internalStatement,
ConnectionHandle connectionHandle,
boolean logStatementsEnabled)
internalStatement - wrapper to statementconnectionHandle - Handle to the connection that this statement is tied to.logStatementsEnabled - set to true to enable sql logging.| Method Detail |
|---|
public void close()
throws java.sql.SQLException
close in interface java.sql.Statementjava.sql.SQLException
public void addBatch(java.lang.String sql)
throws java.sql.SQLException
addBatch in interface java.sql.Statementjava.sql.SQLExceptionStatement.addBatch(java.lang.String)
public void cancel()
throws java.sql.SQLException
cancel in interface java.sql.Statementjava.sql.SQLExceptionStatement.cancel()
public void clearBatch()
throws java.sql.SQLException
clearBatch in interface java.sql.Statementjava.sql.SQLExceptionStatement.clearBatch()
public void clearWarnings()
throws java.sql.SQLException
clearWarnings in interface java.sql.Statementjava.sql.SQLExceptionStatement.clearWarnings()
public boolean execute(java.lang.String sql)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionStatement.execute(java.lang.String)
public boolean execute(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionStatement.execute(java.lang.String, int)
public boolean execute(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionStatement.execute(java.lang.String, int[])
public boolean execute(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
execute in interface java.sql.Statementjava.sql.SQLExceptionStatement.execute(java.lang.String, java.lang.String[])
public int[] executeBatch()
throws java.sql.SQLException
executeBatch in interface java.sql.Statementjava.sql.SQLExceptionStatement.executeBatch()
public java.sql.ResultSet executeQuery(java.lang.String sql)
throws java.sql.SQLException
executeQuery in interface java.sql.Statementjava.sql.SQLExceptionStatement.executeQuery(java.lang.String)
public int executeUpdate(java.lang.String sql)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionStatement.executeUpdate(java.lang.String)
public int executeUpdate(java.lang.String sql,
int autoGeneratedKeys)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionStatement.executeUpdate(java.lang.String, int)
public int executeUpdate(java.lang.String sql,
int[] columnIndexes)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionStatement.executeUpdate(java.lang.String, int[])
public int executeUpdate(java.lang.String sql,
java.lang.String[] columnNames)
throws java.sql.SQLException
executeUpdate in interface java.sql.Statementjava.sql.SQLExceptionStatement.executeUpdate(java.lang.String, java.lang.String[])
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface java.sql.Statementjava.sql.SQLExceptionStatement.getConnection()
public int getFetchDirection()
throws java.sql.SQLException
getFetchDirection in interface java.sql.Statementjava.sql.SQLExceptionStatement.getFetchDirection()
public int getFetchSize()
throws java.sql.SQLException
getFetchSize in interface java.sql.Statementjava.sql.SQLExceptionStatement.getFetchSize()
public java.sql.ResultSet getGeneratedKeys()
throws java.sql.SQLException
getGeneratedKeys in interface java.sql.Statementjava.sql.SQLExceptionStatement.getGeneratedKeys()
public int getMaxFieldSize()
throws java.sql.SQLException
getMaxFieldSize in interface java.sql.Statementjava.sql.SQLExceptionStatement.getMaxFieldSize()
public int getMaxRows()
throws java.sql.SQLException
getMaxRows in interface java.sql.Statementjava.sql.SQLExceptionStatement.getMaxRows()
public boolean getMoreResults()
throws java.sql.SQLException
getMoreResults in interface java.sql.Statementjava.sql.SQLExceptionStatement.getMoreResults()
public boolean getMoreResults(int current)
throws java.sql.SQLException
getMoreResults in interface java.sql.Statementjava.sql.SQLExceptionStatement.getMoreResults(int)
public int getQueryTimeout()
throws java.sql.SQLException
getQueryTimeout in interface java.sql.Statementjava.sql.SQLExceptionStatement.getQueryTimeout()
public java.sql.ResultSet getResultSet()
throws java.sql.SQLException
getResultSet in interface java.sql.Statementjava.sql.SQLExceptionStatement.getResultSet()
public int getResultSetConcurrency()
throws java.sql.SQLException
getResultSetConcurrency in interface java.sql.Statementjava.sql.SQLExceptionStatement.getResultSetConcurrency()
public int getResultSetHoldability()
throws java.sql.SQLException
getResultSetHoldability in interface java.sql.Statementjava.sql.SQLExceptionStatement.getResultSetHoldability()
public int getResultSetType()
throws java.sql.SQLException
getResultSetType in interface java.sql.Statementjava.sql.SQLExceptionStatement.getResultSetType()
public int getUpdateCount()
throws java.sql.SQLException
getUpdateCount in interface java.sql.Statementjava.sql.SQLExceptionStatement.getUpdateCount()
public java.sql.SQLWarning getWarnings()
throws java.sql.SQLException
getWarnings in interface java.sql.Statementjava.sql.SQLExceptionStatement.getWarnings()public boolean isClosed()
isClosed in interface java.sql.Statement
public void setPoolable(boolean poolable)
throws java.sql.SQLException
setPoolable in interface java.sql.Statementjava.sql.SQLException
public boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.Wrapperjava.sql.SQLException
public <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperjava.sql.SQLException
public boolean isPoolable()
throws java.sql.SQLException
isPoolable in interface java.sql.Statementjava.sql.SQLException
public void setCursorName(java.lang.String name)
throws java.sql.SQLException
setCursorName in interface java.sql.Statementjava.sql.SQLException
public void setEscapeProcessing(boolean enable)
throws java.sql.SQLException
setEscapeProcessing in interface java.sql.Statementjava.sql.SQLExceptionStatement.setEscapeProcessing(boolean)
public void setFetchDirection(int direction)
throws java.sql.SQLException
setFetchDirection in interface java.sql.Statementjava.sql.SQLExceptionStatement.setFetchDirection(int)
public void setFetchSize(int rows)
throws java.sql.SQLException
setFetchSize in interface java.sql.Statementjava.sql.SQLExceptionStatement.setFetchSize(int)
public void setMaxFieldSize(int max)
throws java.sql.SQLException
setMaxFieldSize in interface java.sql.Statementjava.sql.SQLExceptionStatement.setMaxFieldSize(int)
public void setMaxRows(int max)
throws java.sql.SQLException
setMaxRows in interface java.sql.Statementjava.sql.SQLExceptionStatement.setMaxRows(int)
public void setQueryTimeout(int seconds)
throws java.sql.SQLException
setQueryTimeout in interface java.sql.Statementjava.sql.SQLExceptionStatement.setQueryTimeout(int)public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getOpenStackTrace()
public void setOpenStackTrace(java.lang.String openStackTrace)
openStackTrace - the openStackTrace to setpublic java.sql.Statement getInternalStatement()
public void setInternalStatement(java.sql.Statement internalStatement)
internalStatement - the internalStatement to setpublic void setDebugHandle(java.lang.Object debugHandle)
debugHandle - any object.public java.lang.Object getDebugHandle()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||