|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.monitor.db.internal.StasiStatement
public class StasiStatement
A simple wrapper for Statement to be able to find resource problems
while reading and writing to the database. It allows us also to measure times
of SQL statements.
Why the name "Stasi..."? The Stasi was the official state security service of
Eastern Germany which controls the people (like NSA in the U.S. or KGB in
Russia, see also Wikipedia).
The StasiStatement controls the embedded Statement - therefore the
name.
| Field Summary |
|---|
| 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 | |
|---|---|
StasiStatement(Statement statement)
Instantiates a new proxy statement. |
|
| Method Summary | ||
|---|---|---|
void |
addBatch(String sql)
Adds the batch. |
|
void |
cancel()
Cancel. |
|
void |
clearBatch()
Clear batch. |
|
void |
clearWarnings()
Clear warnings. |
|
void |
close()
Close. |
|
void |
closeOnCompletion()
Close on completion. |
|
protected SQLException |
enrichedSQLException(ProfileMonitor mon,
String sql,
SQLException original)
For better error analysis the original SQLException will be
enriched with some additional infos. |
|
boolean |
execute(String sql)
Execute. |
|
boolean |
execute(String sql,
int autoGeneratedKeys)
Execute. |
|
boolean |
execute(String sql,
int[] columnIndexes)
Execute. |
|
boolean |
execute(String sql,
String[] columnNames)
Execute. |
|
int[] |
executeBatch()
Execute batch. |
|
ResultSet |
executeQuery(String sql)
Execute query. |
|
int |
executeUpdate(String sql)
Execute update. |
|
int |
executeUpdate(String sql,
int autoGeneratedKeys)
Execute update. |
|
int |
executeUpdate(String sql,
int[] columnIndexes)
Execute update. |
|
int |
executeUpdate(String sql,
String[] columnNames)
Execute update. |
|
Connection |
getConnection()
Gets the connection. |
|
int |
getFetchDirection()
Gets the fetch direction. |
|
int |
getFetchSize()
Gets the fetch size. |
|
ResultSet |
getGeneratedKeys()
Gets the generated keys. |
|
int |
getMaxFieldSize()
Gets the max field size. |
|
int |
getMaxRows()
Gets the max rows. |
|
boolean |
getMoreResults()
Gets the more results. |
|
boolean |
getMoreResults(int current)
Gets the more results. |
|
int |
getQueryTimeout()
Gets the query timeout. |
|
ResultSet |
getResultSet()
Gets the result set. |
|
int |
getResultSetConcurrency()
Gets the result set concurrency. |
|
int |
getResultSetHoldability()
Gets the result set holdability. |
|
int |
getResultSetType()
Gets the result set type. |
|
protected Statement |
getStatement()
Gets the statement. |
|
int |
getUpdateCount()
Gets the update count. |
|
SQLWarning |
getWarnings()
Gets the warnings. |
|
boolean |
isClosed()
Checks if is closed. |
|
boolean |
isCloseOnCompletion()
Checks if is close on completion. |
|
boolean |
isPoolable()
Checks if is poolable. |
|
boolean |
isWrapperFor(Class<?> arg0)
Checks if is wrapper for. |
|
void |
setCursorName(String name)
Sets the cursor name. |
|
void |
setEscapeProcessing(boolean enable)
Sets the escape processing. |
|
void |
setFetchDirection(int direction)
Sets the fetch direction. |
|
void |
setFetchSize(int rows)
Sets the fetch size. |
|
void |
setMaxFieldSize(int max)
Sets the max field size. |
|
void |
setMaxRows(int max)
Sets the max rows. |
|
void |
setPoolable(boolean poolable)
Sets the poolable. |
|
void |
setQueryTimeout(int seconds)
Sets the query timeout. |
|
|
unwrap(Class<T> arg0)
Unwrap. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StasiStatement(Statement statement)
statement - the statement| Method Detail |
|---|
protected final Statement getStatement()
public final void addBatch(String sql)
throws SQLException
addBatch in interface Statementsql - the sql
SQLException - the sQL exceptionStatement.addBatch(java.lang.String)
public final void cancel()
throws SQLException
cancel in interface StatementSQLException - the sQL exceptionStatement.cancel()
public final void clearBatch()
throws SQLException
clearBatch in interface StatementSQLException - the sQL exceptionStatement.clearBatch()
public final void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLException - the sQL exceptionStatement.clearWarnings()
public void close()
throws SQLException
close in interface StatementSQLException - the sQL exceptionStatement.close()
public final boolean execute(String sql,
int autoGeneratedKeys)
throws SQLException
execute in interface Statementsql - the sqlautoGeneratedKeys - the auto generated keys
SQLException - the sQL exceptionStatement.execute(java.lang.String, int)
public final boolean execute(String sql,
int[] columnIndexes)
throws SQLException
execute in interface Statementsql - the sqlcolumnIndexes - the column indexes
SQLException - the sQL exceptionStatement.execute(java.lang.String, int[])
public final boolean execute(String sql,
String[] columnNames)
throws SQLException
execute in interface Statementsql - the sqlcolumnNames - the column names
SQLException - the sQL exceptionStatement.execute(java.lang.String, java.lang.String[])
public final boolean execute(String sql)
throws SQLException
execute in interface Statementsql - the sql
SQLException - the sQL exceptionStatement.execute(java.lang.String)
public final int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLException - the sQL exceptionStatement.executeBatch()
public final ResultSet executeQuery(String sql)
throws SQLException
executeQuery in interface Statementsql - the sql
SQLException - the sQL exceptionStatement.executeQuery(java.lang.String)
public final int executeUpdate(String sql,
int autoGeneratedKeys)
throws SQLException
executeUpdate in interface Statementsql - the sqlautoGeneratedKeys - the auto generated keys
SQLException - the sQL exceptionStatement.executeUpdate(java.lang.String, int)
public final int executeUpdate(String sql,
int[] columnIndexes)
throws SQLException
executeUpdate in interface Statementsql - the sqlcolumnIndexes - the column indexes
SQLException - the sQL exceptionStatement.executeUpdate(java.lang.String, int[])
public final int executeUpdate(String sql,
String[] columnNames)
throws SQLException
executeUpdate in interface Statementsql - the sqlcolumnNames - the column names
SQLException - the sQL exceptionStatement.executeUpdate(java.lang.String, java.lang.String[])
public final int executeUpdate(String sql)
throws SQLException
executeUpdate in interface Statementsql - the sql
SQLException - the sQL exceptionStatement.executeUpdate(java.lang.String)
protected SQLException enrichedSQLException(ProfileMonitor mon,
String sql,
SQLException original)
SQLException will be
enriched with some additional infos.
mon - the monsql - the sqloriginal - the original
public final Connection getConnection()
throws SQLException
getConnection in interface StatementSQLException - the sQL exceptionStatement.getConnection()
public final int getFetchDirection()
throws SQLException
getFetchDirection in interface StatementSQLException - the sQL exceptionStatement.getFetchDirection()
public final int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLException - the sQL exceptionStatement.getFetchSize()
public final ResultSet getGeneratedKeys()
throws SQLException
getGeneratedKeys in interface StatementSQLException - the sQL exceptionStatement.getGeneratedKeys()
public final int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLException - the sQL exceptionStatement.getMaxFieldSize()
public final int getMaxRows()
throws SQLException
getMaxRows in interface StatementSQLException - the sQL exceptionStatement.getMaxRows()
public final boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLException - the sQL exceptionStatement.getMoreResults()
public final boolean getMoreResults(int current)
throws SQLException
getMoreResults in interface Statementcurrent - the current
SQLException - the sQL exceptionStatement.getMoreResults(int)
public final int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLException - the sQL exceptionStatement.getQueryTimeout()
public final ResultSet getResultSet()
throws SQLException
getResultSet in interface StatementSQLException - the sQL exceptionStatement.getResultSet()
public final int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLException - the sQL exceptionStatement.getResultSetConcurrency()
public final int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLException - the sQL exceptionStatement.getResultSetHoldability()
public final int getResultSetType()
throws SQLException
getResultSetType in interface StatementSQLException - the sQL exceptionStatement.getResultSetType()
public final int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLException - the sQL exceptionStatement.getUpdateCount()
public final SQLWarning getWarnings()
throws SQLException
getWarnings in interface StatementSQLException - the sQL exceptionStatement.getWarnings()
public final boolean isClosed()
throws SQLException
isClosed in interface StatementSQLException - the sQL exceptionStatement.isClosed()
public final boolean isPoolable()
throws SQLException
isPoolable in interface StatementSQLException - the sQL exceptionStatement.isPoolable()
public final boolean isWrapperFor(Class<?> arg0)
throws SQLException
isWrapperFor in interface Wrapperarg0 - the arg0
SQLException - the sQL exceptionWrapper.isWrapperFor(java.lang.Class)
public final void setCursorName(String name)
throws SQLException
setCursorName in interface Statementname - the new cursor name
SQLException - the sQL exceptionStatement.setCursorName(java.lang.String)
public final void setEscapeProcessing(boolean enable)
throws SQLException
setEscapeProcessing in interface Statementenable - the new escape processing
SQLException - the sQL exceptionStatement.setEscapeProcessing(boolean)
public final void setFetchDirection(int direction)
throws SQLException
setFetchDirection in interface Statementdirection - the new fetch direction
SQLException - the sQL exceptionStatement.setFetchDirection(int)
public final void setFetchSize(int rows)
throws SQLException
setFetchSize in interface Statementrows - the new fetch size
SQLException - the sQL exceptionStatement.setFetchSize(int)
public final void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize in interface Statementmax - the new max field size
SQLException - the sQL exceptionStatement.setMaxFieldSize(int)
public final void setMaxRows(int max)
throws SQLException
setMaxRows in interface Statementmax - the new max rows
SQLException - the sQL exceptionStatement.setMaxRows(int)
public final void setPoolable(boolean poolable)
throws SQLException
setPoolable in interface Statementpoolable - the new poolable
SQLException - the sQL exceptionStatement.setPoolable(boolean)
public final void setQueryTimeout(int seconds)
throws SQLException
setQueryTimeout in interface Statementseconds - the new query timeout
SQLException - the sQL exceptionStatement.setQueryTimeout(int)
public final <T> T unwrap(Class<T> arg0)
throws SQLException
unwrap in interface WrapperT - the generic typearg0 - the arg0
SQLException - the sQL exceptionWrapper.unwrap(java.lang.Class)
public final void closeOnCompletion()
throws SQLException
SQLException - the SQL exception
public final boolean isCloseOnCompletion()
throws SQLException
SQLException - the SQL exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||