|
MySQL Connector/J size='-1'>5.0.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mysql.jdbc.jdbc2.optional.ConnectionWrapper
public class ConnectionWrapper
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.
org.gjt.mm.mysql.jdbc2.Connection
,
org.gjt.mm.mysql.jdbc2.optional.MysqlPooledConnection
Field Summary | |
---|---|
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,
Connection mysqlConnection,
boolean forXa)
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. |
java.sql.PreparedStatement |
clientPrepare(java.lang.String sql)
|
java.sql.PreparedStatement |
clientPrepare(java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
|
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)
|
boolean |
getAutoCommit()
Passes call to method on physical connection instance. |
java.lang.String |
getCatalog()
Passes call to method on physical connection instance. |
int |
getHoldability()
|
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. |
protected boolean |
isInGlobalTx()
|
boolean |
isMasterConnection()
|
boolean |
isReadOnly()
Passes call to method on physical connection instance. |
boolean |
isSameResource(java.sql.Connection c)
|
java.lang.String |
nativeSQL(java.lang.String sql)
Passes call to method on physical connection instance. |
void |
ping()
|
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)
|
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)
|
java.sql.PreparedStatement |
prepareStatement(java.lang.String arg0,
java.lang.String[] arg1)
|
void |
releaseSavepoint(java.sql.Savepoint arg0)
|
void |
rollback()
Passes call to method on physical connection instance. |
void |
rollback(java.sql.Savepoint arg0)
|
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)
|
protected void |
setInGlobalTx(boolean flag)
|
void |
setReadOnly(boolean readOnly)
Passes call to method on physical connection instance. |
java.sql.Savepoint |
setSavepoint()
|
java.sql.Savepoint |
setSavepoint(java.lang.String arg0)
|
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 |
---|
protected MysqlPooledConnection pooledConnection
Constructor Detail |
---|
public ConnectionWrapper(MysqlPooledConnection mysqlPooledConnection, Connection mysqlConnection, boolean forXa) throws java.sql.SQLException
mysqlPooledConnection
- reference to object that instantiated this objectmysqlConnection
- physical connection to db
java.sql.SQLException
- if an error occurs.Method Detail |
---|
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
java.sql.SQLException
Connection.setAutoCommit(boolean)
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
java.sql.SQLException
Connection.getAutoCommit()
public void setCatalog(java.lang.String catalog) throws java.sql.SQLException
setCatalog
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#setCatalog()
public java.lang.String getCatalog() throws java.sql.SQLException
getCatalog
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic boolean isClosed() throws java.sql.SQLException
isClosed
in interface java.sql.Connection
java.sql.SQLException
Connection.isClosed()
public boolean isMasterConnection() throws java.sql.SQLException
java.sql.SQLException
public void setHoldability(int arg0) throws java.sql.SQLException
setHoldability
in interface java.sql.Connection
java.sql.SQLException
Connection.setHoldability(int)
public int getHoldability() throws java.sql.SQLException
getHoldability
in interface java.sql.Connection
java.sql.SQLException
Connection.getHoldability()
public long getIdleFor()
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
getMetaData
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void setReadOnly(boolean readOnly) throws java.sql.SQLException
setReadOnly
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#setReadOnly()
public boolean isReadOnly() throws java.sql.SQLException
isReadOnly
in interface java.sql.Connection
java.sql.SQLException
Connection.isReadOnly()
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
Connection.setSavepoint()
public java.sql.Savepoint setSavepoint(java.lang.String arg0) throws java.sql.SQLException
setSavepoint
in interface java.sql.Connection
java.sql.SQLException
Connection.setSavepoint(String)
public void setTransactionIsolation(int level) throws java.sql.SQLException
setTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#setTransactionIsolation()
public int getTransactionIsolation() throws java.sql.SQLException
getTransactionIsolation
in interface java.sql.Connection
java.sql.SQLException
Connection.getTransactionIsolation()
public void setTypeMap(java.util.Map map) throws java.sql.SQLException
setTypeMap
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#setTypeMap()
public java.util.Map getTypeMap() throws java.sql.SQLException
getTypeMap
in interface java.sql.Connection
java.sql.SQLException
Connection.getTypeMap()
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
getWarnings
in interface java.sql.Connection
java.sql.SQLException
Connection.getWarnings()
public void clearWarnings() throws java.sql.SQLException
clearWarnings
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void close() throws java.sql.SQLException
close
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
java.sql.SQLException
- if an error occurspublic java.sql.Statement createStatement() throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.createStatement()
public java.sql.Statement createStatement(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.createStatement()
public java.sql.Statement createStatement(int arg0, int arg1, int arg2) throws java.sql.SQLException
createStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.createStatement(int, int, int)
public java.lang.String nativeSQL(java.lang.String sql) throws java.sql.SQLException
nativeSQL
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#nativeSQL()
public java.sql.CallableStatement prepareCall(java.lang.String sql) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#prepareCall()
public java.sql.CallableStatement prepareCall(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#prepareCall()
public java.sql.CallableStatement prepareCall(java.lang.String arg0, int arg1, int arg2, int arg3) throws java.sql.SQLException
prepareCall
in interface java.sql.Connection
java.sql.SQLException
Connection.prepareCall(String, int, int, int)
public java.sql.PreparedStatement clientPrepare(java.lang.String sql) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement clientPrepare(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
java.sql.SQLException
public java.sql.PreparedStatement prepareStatement(java.lang.String sql) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#prepareStatement()
public java.sql.PreparedStatement prepareStatement(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
java.sql.Connection#prepareStatement()
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1, int arg2, int arg3) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.prepareStatement(String, int, int, int)
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int arg1) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.prepareStatement(String, int)
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, int[] arg1) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.prepareStatement(String, int[])
public java.sql.PreparedStatement prepareStatement(java.lang.String arg0, java.lang.String[] arg1) throws java.sql.SQLException
prepareStatement
in interface java.sql.Connection
java.sql.SQLException
Connection.prepareStatement(String, String[])
public void releaseSavepoint(java.sql.Savepoint arg0) throws java.sql.SQLException
releaseSavepoint
in interface java.sql.Connection
java.sql.SQLException
Connection.releaseSavepoint(Savepoint)
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
Connection.rollback()
public void rollback(java.sql.Savepoint arg0) throws java.sql.SQLException
rollback
in interface java.sql.Connection
java.sql.SQLException
Connection.rollback(Savepoint)
public boolean isSameResource(java.sql.Connection c)
protected void close(boolean fireClosedEvent) throws java.sql.SQLException
java.sql.SQLException
protected boolean isInGlobalTx()
protected void setInGlobalTx(boolean flag)
public void ping() throws java.sql.SQLException
java.sql.SQLException
protected void checkAndFireConnectionError(java.sql.SQLException sqlEx) throws java.sql.SQLException
sqlEx
- the SQLException that has ocurred
java.sql.SQLException
- (rethrown)
|
MySQL Connector/J size='-1'>5.0.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |