|
|||||||||
| Home >> All >> com >> mysql >> jdbc >> jdbc2 >> [ optional overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.mysql.jdbc.jdbc2.optional
Class ConnectionWrapper

java.lang.Objectcom.mysql.jdbc.jdbc2.optional.WrapperBase
com.mysql.jdbc.jdbc2.optional.ConnectionWrapper
- All Implemented Interfaces:
- java.sql.Connection
- class ConnectionWrapper
- extends WrapperBase
- implements java.sql.Connection
- extends WrapperBase
This class serves as a wrapper for the org.gjt.mm.mysql.jdbc2.Connection class. It is returned to the application server which may wrap it again and then return it to the application client in response to dataSource.getConnection().
All method invocations are forwarded to org.gjt.mm.mysql.jdbc2.Connection unless the close method was previously called, in which case a sqlException is thrown. The close method performs a 'logical close' on the connection.
All sqlExceptions thrown by the physical connection are intercepted and sent to connectionEvent listeners before being thrown to client.
| Field Summary | |
private boolean |
closed
|
private java.lang.String |
invalidHandleStr
|
private java.sql.Connection |
mc
|
private MysqlPooledConnection |
mpc
|
protected MysqlPooledConnection |
pooledConnection
|
| Fields inherited from interface java.sql.Connection |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Constructor Summary | |
ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection,
java.sql.Connection mysqlConnection)
Construct a new LogicalHandle and set instance variables |
|
| Method Summary | |
protected void |
checkAndFireConnectionError(java.sql.SQLException sqlEx)
Fires connection error event if required, before re-throwing exception |
void |
clearWarnings()
Passes call to method on physical connection instance. |
void |
close()
The physical connection is not actually closed. |
protected void |
close(boolean fireClosedEvent)
|
void |
commit()
Passes call to method on physical connection instance. |
java.sql.Statement |
createStatement()
Passes call to method on physical connection instance. |
java.sql.Statement |
createStatement(int resultSetType,
int resultSetConcurrency)
Passes call to method on physical connection instance. |
java.sql.Statement |
createStatement(int arg0,
int arg1,
int arg2)
This method creates a new SQL statement with the specified type, concurrency and holdability, instead of using the defaults. |
boolean |
getAutoCommit()
Passes call to method on physical connection instance. |
java.lang.String |
getCatalog()
Passes call to method on physical connection instance. |
int |
getHoldability()
Gets the default holdability of ResultSetS that are created
from StatementS using this Connection. |
long |
getIdleFor()
Allows clients to determine how long this connection has been idle. |
java.sql.DatabaseMetaData |
getMetaData()
Passes call to method on physical connection instance. |
int |
getTransactionIsolation()
Passes call to method on physical connection instance. |
java.util.Map |
getTypeMap()
Passes call to method on physical connection instance. |
java.sql.SQLWarning |
getWarnings()
Passes call to method on physical connection instance. |
boolean |
isClosed()
Passes call to method on physical connection instance. |
boolean |
isReadOnly()
Passes call to method on physical connection instance. |
java.lang.String |
nativeSQL(java.lang.String sql)
Passes call to method on physical connection instance. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql)
Passes call to method on physical connection instance. |
java.sql.CallableStatement |
prepareCall(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Passes call to method on physical connection instance. |
java.sql.CallableStatement |
prepareCall(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
This method creates a new CallableStatement for the
specified SQL string. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql)
Passes call to method on physical connection instance. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int arg1)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int[] arg1)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Passes call to method on physical connection instance. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
int arg1,
int arg2,
int arg3)
This method creates a new PreparedStatement for the specified
SQL string. |
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
java.lang.String[] arg1)
|
void |
releaseSavepoint(java.sql.Savepoint arg0)
Removes the specified savepoint from this Connection. |
void |
rollback()
Passes call to method on physical connection instance. |
void |
rollback(java.sql.Savepoint arg0)
Undoes all changes made after the specified savepoint was set. |
void |
setAutoCommit(boolean autoCommit)
Passes call to method on physical connection instance. |
void |
setCatalog(java.lang.String catalog)
Passes call to method on physical connection instance. |
void |
setHoldability(int arg0)
Sets the default holdability of ResultSetS that are created
from StatementS using this Connection. |
void |
setReadOnly(boolean readOnly)
Passes call to method on physical connection instance. |
java.sql.Savepoint |
setSavepoint()
Creates a new unnamed savepoint for this Connection |
java.sql.Savepoint |
setSavepoint(java.lang.String arg0)
Creates a new savepoint with the specifiend name for this Connection. |
void |
setTransactionIsolation(int level)
Passes call to method on physical connection instance. |
void |
setTypeMap(java.util.Map map)
Passes call to method on physical connection instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
mc
private java.sql.Connection mc
mpc
private MysqlPooledConnection mpc
invalidHandleStr
private java.lang.String invalidHandleStr
closed
private boolean closed
pooledConnection
protected MysqlPooledConnection pooledConnection
| Constructor Detail |
ConnectionWrapper
public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection, java.sql.Connection mysqlConnection) throws java.sql.SQLException
- Construct a new LogicalHandle and set instance variables
| Method Detail |
setAutoCommit
public void setAutoCommit(boolean autoCommit)
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
setAutoCommitin interfacejava.sql.Connection
getAutoCommit
public boolean getAutoCommit()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
getAutoCommitin interfacejava.sql.Connection
setCatalog
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
setCatalogin interfacejava.sql.Connection
getCatalog
public java.lang.String getCatalog() throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
getCatalogin interfacejava.sql.Connection
isClosed
public boolean isClosed()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
isClosedin interfacejava.sql.Connection
setHoldability
public void setHoldability(int arg0)
throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - Sets the default holdability of
ResultSetS that are created fromStatementS using thisConnection.- Specified by:
setHoldabilityin interfacejava.sql.Connection
getHoldability
public int getHoldability()
throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - Gets the default holdability of
ResultSetS that are created fromStatementS using thisConnection.- Specified by:
getHoldabilityin interfacejava.sql.Connection
getIdleFor
public long getIdleFor()
- Allows clients to determine how long this connection has been idle.
getMetaData
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
getMetaDatain interfacejava.sql.Connection
setReadOnly
public void setReadOnly(boolean readOnly)
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
setReadOnlyin interfacejava.sql.Connection
isReadOnly
public boolean isReadOnly()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
isReadOnlyin interfacejava.sql.Connection
setSavepoint
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - Creates a new unnamed savepoint for this
Connection- Specified by:
setSavepointin interfacejava.sql.Connection
setSavepoint
public java.sql.Savepoint setSavepoint(java.lang.String arg0) throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - Creates a new savepoint with the specifiend name for this
Connection.- Specified by:
setSavepointin interfacejava.sql.Connection
setTransactionIsolation
public void setTransactionIsolation(int level)
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
setTransactionIsolationin interfacejava.sql.Connection
getTransactionIsolation
public int getTransactionIsolation()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
getTransactionIsolationin interfacejava.sql.Connection
setTypeMap
public void setTypeMap(java.util.Map map) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
setTypeMapin interfacejava.sql.Connection
getTypeMap
public java.util.Map getTypeMap() throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
getTypeMapin interfacejava.sql.Connection
getWarnings
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
getWarningsin interfacejava.sql.Connection
clearWarnings
public void clearWarnings()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
clearWarningsin interfacejava.sql.Connection
close
public void close()
throws java.sql.SQLException
- The physical connection is not actually closed. the physical connection
is closed when the application server calls
mysqlPooledConnection.close(). this object is de-referenced by the
pooled connection each time mysqlPooledConnection.getConnection() is
called by app server.
- Specified by:
closein interfacejava.sql.Connection
commit
public void commit()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
commitin interfacejava.sql.Connection
createStatement
public java.sql.Statement createStatement() throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
createStatementin interfacejava.sql.Connection
createStatement
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
createStatementin interfacejava.sql.Connection
createStatement
public java.sql.Statement createStatement(int arg0, int arg1, int arg2) throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - This method creates a new SQL statement with the specified type,
concurrency and holdability, instead of using the defaults. Valid values
for these parameters are specified in the
ResultSetclass.- Specified by:
createStatementin interfacejava.sql.Connection
nativeSQL
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
nativeSQLin interfacejava.sql.Connection
prepareCall
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
prepareCallin interfacejava.sql.Connection
prepareCall
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
prepareCallin interfacejava.sql.Connection
prepareCall
public java.sql.CallableStatement prepareCall(java.lang.String arg0, int arg1, int arg2, int arg3) throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - This method creates a new
CallableStatementfor the specified SQL string. Thie method is designed to be used with stored procedures. The specified result set type, concurrency and holdability will be used. Valid values for these parameters are specified in theResultSetclass.- Specified by:
prepareCallin interfacejava.sql.Connection
prepareStatement
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
prepareStatementin interfacejava.sql.Connection
prepareStatement
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
prepareStatementin interfacejava.sql.Connection
prepareStatement
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1, int arg2, int arg3) throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - This method creates a new
PreparedStatementfor the specified SQL string. This method is designed for use with parameterized statements. The specified result set type, concurrency and holdability will be used. Valid values for these parameters are specified in theResultSetclass.- Specified by:
prepareStatementin interfacejava.sql.Connection
prepareStatement
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1) throws java.sql.SQLException
- Specified by:
prepareStatementin interfacejava.sql.Connection
prepareStatement
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int[] arg1) throws java.sql.SQLException
- Specified by:
prepareStatementin interfacejava.sql.Connection
prepareStatement
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, java.lang.String[] arg1) throws java.sql.SQLException
- Specified by:
prepareStatementin interfacejava.sql.Connection
releaseSavepoint
public void releaseSavepoint(java.sql.Savepoint arg0) throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - Removes the specified savepoint from this
Connection. Refering to a savepoint after it was removed is an error and will throw an SQLException.- Specified by:
releaseSavepointin interfacejava.sql.Connection
rollback
public void rollback()
throws java.sql.SQLException
- Passes call to method on physical connection instance. Notifies
listeners of any caught exceptions before re-throwing to client.
- Specified by:
rollbackin interfacejava.sql.Connection
rollback
public void rollback(java.sql.Savepoint arg0) throws java.sql.SQLException
- Description copied from interface:
java.sql.Connection - Undoes all changes made after the specified savepoint was set.
- Specified by:
rollbackin interfacejava.sql.Connection
close
protected void close(boolean fireClosedEvent)
throws java.sql.SQLException
checkAndFireConnectionError
protected void checkAndFireConnectionError(java.sql.SQLException sqlEx) throws java.sql.SQLException
- Fires connection error event if required, before re-throwing exception
|
|||||||||
| Home >> All >> com >> mysql >> jdbc >> jdbc2 >> [ optional overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC