|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.jdbc.SimonStatement
public class SimonStatement
Simon JDBC proxy statement implementation class.
Statement| Field Summary | |
|---|---|
protected List<String> |
batchSql
List of batched SQL statements. |
protected Connection |
conn
SQL connection. |
protected String |
prefix
Hierarchy prefix for JDBC Simons. |
protected Split |
split
Stopwatch split measuring the lifespan of the statement until it is closed across all executes. |
protected String |
sqlCmdLabel
SQL statement label containing part up to the SQL command type. |
protected SqlNormalizer |
sqlNormalizer
SQL normalizer helper object. |
private Statement |
stmt
|
| 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 | |
|---|---|
SimonStatement(Connection conn,
Statement stmt,
String prefix)
Class constructor, initializes Simons (lifespan, active) related to statement. |
|
| Method Summary | |
|---|---|
void |
addBatch(String s)
Adds given SQL command into batch list of sql and also into real batch. |
void |
cancel()
|
void |
clearBatch()
Clears batch sql list and real batch too. |
void |
clearWarnings()
|
void |
close()
Closes real statement, stops lifespan Simon and decrease active Simon. |
boolean |
execute(String sql)
Measure and execute SQL operation. |
boolean |
execute(String sql,
int autoGeneratedKeys)
Measure and execute SQL operation. |
boolean |
execute(String sql,
int[] columnIndexes)
Measure and execute SQL operation. |
boolean |
execute(String sql,
String[] columnNames)
Measure and execute SQL operation. |
int[] |
executeBatch()
Measure and execute SQL operation. |
ResultSet |
executeQuery(String sql)
Measure and execute SQL operation. |
int |
executeUpdate(String sql)
Measure and execute SQL operation. |
int |
executeUpdate(String sql,
int autoGeneratedKeys)
Measure and execute SQL operation. |
int |
executeUpdate(String sql,
int[] columnIndexes)
Measure and execute SQL operation. |
int |
executeUpdate(String sql,
String[] columnNames)
Measure and execute SQL operation. |
protected void |
finish(Split split)
Called after each SQL command execution. |
Connection |
getConnection()
Returns a connection object (simon impl.). |
int |
getFetchDirection()
|
int |
getFetchSize()
|
ResultSet |
getGeneratedKeys()
|
int |
getMaxFieldSize()
|
int |
getMaxRows()
|
boolean |
getMoreResults()
|
boolean |
getMoreResults(int i)
|
int |
getQueryTimeout()
|
ResultSet |
getResultSet()
|
int |
getResultSetConcurrency()
|
int |
getResultSetHoldability()
|
int |
getResultSetType()
|
int |
getUpdateCount()
|
SQLWarning |
getWarnings()
|
protected Split |
prepare(List<String> sqls)
Called before each SQL command execution. |
protected Split |
prepare(String sql)
Called before each SQL command execution. |
void |
setCursorName(String s)
|
void |
setEscapeProcessing(boolean b)
|
void |
setFetchDirection(int i)
|
void |
setFetchSize(int i)
|
void |
setMaxFieldSize(int i)
|
void |
setMaxRows(int i)
|
void |
setQueryTimeout(int i)
|
protected Split |
startSplit()
Starts the split for the SQL specific stopwatch, sets the note and returns the split. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.sql.Statement |
|---|
isClosed, isPoolable, setPoolable |
| Methods inherited from interface java.sql.Wrapper |
|---|
isWrapperFor, unwrap |
| Field Detail |
|---|
protected final List<String> batchSql
protected Connection conn
protected String prefix
protected String sqlCmdLabel
protected SqlNormalizer sqlNormalizer
protected Split split
private Statement stmt
| Constructor Detail |
|---|
SimonStatement(Connection conn,
Statement stmt,
String prefix)
conn - database connection (simon impl.)stmt - real statementprefix - hierarchy prefix for JDBC Simons| Method Detail |
|---|
public final void close()
throws SQLException
close in interface StatementSQLException - if real operation failspublic final Connection getConnection()
getConnection in interface Statementprotected final Split prepare(String sql)
Stopwatch Simon
for measure SQL operation.
sql - sql command for execution
protected final Split prepare(List<String> sqls)
Stopwatch Simon
for measure bach SQL operations.
sqls - list of sql commands
protected Split startSplit()
protected final void finish(Split split)
prepare(String)),
also adds time to SQL command type Simon and sets human readable SQL cmd as note.
split - started Stopwatch split
public final ResultSet executeQuery(String sql)
throws SQLException
executeQuery in interface Statementsql - sql command
SQLException - if real calls failsSimonResultSet
public final int executeUpdate(String sql)
throws SQLException
executeUpdate in interface Statementsql - sql command
SQLException - if real calls fails
public final int executeUpdate(String sql,
int autoGeneratedKeys)
throws SQLException
executeUpdate in interface Statementsql - sql commandautoGeneratedKeys - autoGeneratedKeys flag
SQLException - if real calls fails
public final int executeUpdate(String sql,
int[] columnIndexes)
throws SQLException
executeUpdate in interface Statementsql - sql commandcolumnIndexes - an array of column indexes indicating the columns that should be
returned from the inserted row
SQLException - if real calls fails
public final int executeUpdate(String sql,
String[] columnNames)
throws SQLException
executeUpdate in interface Statementsql - sql commandcolumnNames - an array of column indexes indicating the columns that should be
returned from the inserted row
SQLException - if real calls fails
public final boolean execute(String sql)
throws SQLException
execute in interface Statementsql - sql command
true if the first result is a ResultSet object;
false if it is an update count or there are no results
SQLException - if real calls fails
public final boolean execute(String sql,
int autoGeneratedKeys)
throws SQLException
execute in interface Statementsql - sql commandautoGeneratedKeys - autoGeneratedKeys flag
true if the first result is a ResultSet object;
false if it is an update count or there are no results
SQLException - if real calls fails
public final boolean execute(String sql,
int[] columnIndexes)
throws SQLException
execute in interface Statementsql - sql commandcolumnIndexes - an array of column indexes indicating the columns that should be
returned from the inserted row
true if the first result is a ResultSet object;
false if it is an update count or there are no results
SQLException - if real calls fails
public final boolean execute(String sql,
String[] columnNames)
throws SQLException
execute in interface Statementsql - sql commandcolumnNames - an array of column indexes indicating the columns that should be
returned from the inserted row
true if the first result is a ResultSet object;
false if it is an update count or there are no results
SQLException - if real calls fails
public final void addBatch(String s)
throws SQLException
addBatch in interface Statements - sql command
SQLException - if real calls fails
public int[] executeBatch()
throws SQLException
executeBatch in interface StatementSQLException - if real calls fails
public void clearBatch()
throws SQLException
clearBatch in interface StatementSQLException - if real calls fails
public final int getMaxFieldSize()
throws SQLException
getMaxFieldSize in interface StatementSQLException
public final void setMaxFieldSize(int i)
throws SQLException
setMaxFieldSize in interface StatementSQLException
public final int getMaxRows()
throws SQLException
getMaxRows in interface StatementSQLException
public final void setMaxRows(int i)
throws SQLException
setMaxRows in interface StatementSQLException
public final void setEscapeProcessing(boolean b)
throws SQLException
setEscapeProcessing in interface StatementSQLException
public final int getQueryTimeout()
throws SQLException
getQueryTimeout in interface StatementSQLException
public final void setQueryTimeout(int i)
throws SQLException
setQueryTimeout in interface StatementSQLException
public final void cancel()
throws SQLException
cancel in interface StatementSQLException
public final SQLWarning getWarnings()
throws SQLException
getWarnings in interface StatementSQLException
public final void clearWarnings()
throws SQLException
clearWarnings in interface StatementSQLException
public final void setCursorName(String s)
throws SQLException
setCursorName in interface StatementSQLException
public final ResultSet getResultSet()
throws SQLException
getResultSet in interface StatementSQLException
public final int getUpdateCount()
throws SQLException
getUpdateCount in interface StatementSQLException
public final boolean getMoreResults()
throws SQLException
getMoreResults in interface StatementSQLException
public final void setFetchDirection(int i)
throws SQLException
setFetchDirection in interface StatementSQLException
public final int getFetchDirection()
throws SQLException
getFetchDirection in interface StatementSQLException
public final void setFetchSize(int i)
throws SQLException
setFetchSize in interface StatementSQLException
public final int getFetchSize()
throws SQLException
getFetchSize in interface StatementSQLException
public final int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency in interface StatementSQLException
public final int getResultSetType()
throws SQLException
getResultSetType in interface StatementSQLException
public final boolean getMoreResults(int i)
throws SQLException
getMoreResults in interface StatementSQLException
public final ResultSet getGeneratedKeys()
throws SQLException
getGeneratedKeys in interface StatementSQLException
public final int getResultSetHoldability()
throws SQLException
getResultSetHoldability in interface StatementSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||