|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javasimon.jdbc.SimonConnection
public final class SimonConnection
Class implements Simon JDBC proxy connection.
Every method of this connection is implemented as call of real connection method. Several methods have added work with Simons (starting, stoping, etc.) for monitoring purposes.
From all statement-return-methods (createStatement(*),
prepareStatement(*), prepareCall(*)) connection returns own
implementation of statement classes. Those classes are also proxies and provides
additional Simons for monitoring features of JDBC driver.
org.javasimon.jdbc.conn, stopwatch) - measure connection life and countorg.javasimon.jdbc.conn.commits, counter) - measure executed commits of all connectionsorg.javasimon.jdbc.conn.rollbacks, counter) - measure executed rollbacks of all connections
Connection| Field Summary | |
|---|---|
private Counter |
commits
|
private Connection |
conn
|
private Split |
life
|
private Counter |
rollbacks
|
private String |
suffix
|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
|---|---|
SimonConnection(Connection conn,
String prefix)
Class constructor, initializes Simons (lifespan, active, commits and rollbacks) related to DB connection. |
|
| Method Summary | |
|---|---|
void |
clearWarnings()
|
void |
close()
Closes real connection, stops lifespan Simon and decrease active Simon. |
void |
commit()
Commits real connection and increase commits Simon. |
Statement |
createStatement()
Calls real createStatement and wraps returned statement by Simon's statement. |
Statement |
createStatement(int rsType,
int rsConcurrency)
Calls real createStatement and wraps returned statement by Simon's statement. |
Statement |
createStatement(int rsType,
int rsConcurrency,
int rsHoldability)
Calls real createStatement and wraps returned statement by Simon's statement. |
boolean |
getAutoCommit()
|
String |
getCatalog()
|
int |
getHoldability()
|
DatabaseMetaData |
getMetaData()
|
int |
getTransactionIsolation()
|
Map<String,Class<?>> |
getTypeMap()
|
SQLWarning |
getWarnings()
|
boolean |
isClosed()
|
boolean |
isReadOnly()
|
String |
nativeSQL(String s)
|
CallableStatement |
prepareCall(String sql)
Calls real prepareCall and wraps returned statement by Simon's statement. |
CallableStatement |
prepareCall(String sql,
int rsType,
int rsConcurrency)
Calls real prepareCall and wraps returned statement by Simon's statement. |
CallableStatement |
prepareCall(String sql,
int rsType,
int rsConcurrency,
int rsHoldability)
Calls real prepareCall and wraps returned statement by Simon's statement. |
PreparedStatement |
prepareStatement(String sql)
Calls real prepareStatement and wraps returned statement by Simon's statement. |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys)
Calls real prepareStatement and wraps returned statement by Simon's statement. |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes)
Calls real prepareStatement and wraps returned statement by Simon's statement. |
PreparedStatement |
prepareStatement(String sql,
int rsType,
int rsConcurrency)
Calls real prepareStatement and wraps returned statement by Simon's statement. |
PreparedStatement |
prepareStatement(String sql,
int rsType,
int rsConcurrency,
int rsHoldability)
Calls real prepareStatement and wraps returned statement by Simon's statement. |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames)
Calls real prepareStatement and wraps returned statement by Simon's statement. |
void |
releaseSavepoint(Savepoint savepoint)
|
void |
rollback()
Rollback real connection and increase rollbacks Simon. |
void |
rollback(Savepoint savepoint)
Rollback real connection and increase rollbacks Simon. |
void |
setAutoCommit(boolean b)
|
void |
setCatalog(String s)
|
void |
setHoldability(int i)
|
void |
setReadOnly(boolean b)
|
Savepoint |
setSavepoint()
|
Savepoint |
setSavepoint(String s)
|
void |
setTransactionIsolation(int i)
|
void |
setTypeMap(Map<String,Class<?>> stringClassMap)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.sql.Connection |
|---|
createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct, getClientInfo, getClientInfo, isValid, setClientInfo, setClientInfo |
| Methods inherited from interface java.sql.Wrapper |
|---|
isWrapperFor, unwrap |
| Field Detail |
|---|
private Connection conn
private String suffix
private Split life
private Counter commits
private Counter rollbacks
| Constructor Detail |
|---|
public SimonConnection(Connection conn,
String prefix)
conn - real DB connectionprefix - hierarchy prefix for connection Simons| Method Detail |
|---|
public void close()
throws SQLException
close in interface ConnectionSQLException - if real operation fails
public void commit()
throws SQLException
commit in interface ConnectionSQLException - if real commit fails
public void rollback()
throws SQLException
rollback in interface ConnectionSQLException - if real operation fails
public void rollback(Savepoint savepoint)
throws SQLException
rollback in interface Connectionsavepoint - the Savepoint object to roll back to
SQLException - if real operation fails
public Statement createStatement()
throws SQLException
createStatement in interface ConnectionSQLException - if real operation fails
public Statement createStatement(int rsType,
int rsConcurrency)
throws SQLException
createStatement in interface ConnectionrsType - result set typersConcurrency - result set concurrency
SQLException - if real operation fails
public Statement createStatement(int rsType,
int rsConcurrency,
int rsHoldability)
throws SQLException
createStatement in interface ConnectionrsType - result set typersConcurrency - result set concurrencyrsHoldability - result set holdability
SQLException - if real operation fails
public PreparedStatement prepareStatement(String sql)
throws SQLException
prepareStatement in interface Connectionsql - SQL statement
SQLException - if real operation fails
public PreparedStatement prepareStatement(String sql,
int autoGeneratedKeys)
throws SQLException
prepareStatement in interface Connectionsql - SQL statementautoGeneratedKeys - auto generated keys
SQLException - if real operation fails
public PreparedStatement prepareStatement(String sql,
int rsType,
int rsConcurrency)
throws SQLException
prepareStatement in interface Connectionsql - SQL statementrsType - result set typersConcurrency - result set concurrency
SQLException - if real operation fails
public PreparedStatement prepareStatement(String sql,
int rsType,
int rsConcurrency,
int rsHoldability)
throws SQLException
prepareStatement in interface Connectionsql - SQL statementrsType - result set typersConcurrency - result set concurrencyrsHoldability - result set holdability
SQLException - if real operation fails
public PreparedStatement prepareStatement(String sql,
int[] columnIndexes)
throws SQLException
prepareStatement in interface Connectionsql - SQL statementcolumnIndexes - an array of column indexes indicating the columns
that should be returned from the inserted row or rows
SQLException - if real operation fails
public PreparedStatement prepareStatement(String sql,
String[] columnNames)
throws SQLException
prepareStatement in interface Connectionsql - SQL statementcolumnNames - an array of column names indicating the columns
that should be returned from the inserted row or rows
SQLException - if real operation fails
public CallableStatement prepareCall(String sql)
throws SQLException
prepareCall in interface Connectionsql - an SQL statement, typically a JDBC function call escape string
SQLException - if real operation fails
public CallableStatement prepareCall(String sql,
int rsType,
int rsConcurrency)
throws SQLException
prepareCall in interface Connectionsql - an SQL statement, typically a JDBC function call escape stringrsType - result set typersConcurrency - result set concurrency
SQLException - if real operation fails
public CallableStatement prepareCall(String sql,
int rsType,
int rsConcurrency,
int rsHoldability)
throws SQLException
prepareCall in interface Connectionsql - an SQL statement, typically a JDBC function call escape stringrsType - result set typersConcurrency - result set concurrencyrsHoldability - result set holdability
SQLException - if real operation fails
public String nativeSQL(String s)
throws SQLException
nativeSQL in interface ConnectionSQLException
public void setAutoCommit(boolean b)
throws SQLException
setAutoCommit in interface ConnectionSQLException
public boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLException
public boolean isClosed()
throws SQLException
isClosed in interface ConnectionSQLException
public DatabaseMetaData getMetaData()
throws SQLException
getMetaData in interface ConnectionSQLException
public void setReadOnly(boolean b)
throws SQLException
setReadOnly in interface ConnectionSQLException
public boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLException
public void setCatalog(String s)
throws SQLException
setCatalog in interface ConnectionSQLException
public String getCatalog()
throws SQLException
getCatalog in interface ConnectionSQLException
public void setTransactionIsolation(int i)
throws SQLException
setTransactionIsolation in interface ConnectionSQLException
public int getTransactionIsolation()
throws SQLException
getTransactionIsolation in interface ConnectionSQLException
public SQLWarning getWarnings()
throws SQLException
getWarnings in interface ConnectionSQLException
public void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLException
public Map<String,Class<?>> getTypeMap()
throws SQLException
getTypeMap in interface ConnectionSQLException
public void setTypeMap(Map<String,Class<?>> stringClassMap)
throws SQLException
setTypeMap in interface ConnectionSQLException
public void setHoldability(int i)
throws SQLException
setHoldability in interface ConnectionSQLException
public int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLException
public Savepoint setSavepoint()
throws SQLException
setSavepoint in interface ConnectionSQLException
public Savepoint setSavepoint(String s)
throws SQLException
setSavepoint in interface ConnectionSQLException
public void releaseSavepoint(Savepoint savepoint)
throws SQLException
releaseSavepoint in interface ConnectionSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||