Package net.sourceforge.jtds.jdbcx.proxy
Class ConnectionProxy
java.lang.Object
net.sourceforge.jtds.jdbcx.proxy.ConnectionProxy
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper
This class would be better implemented as a java.lang.reflect.Proxy. However, this
feature was not added until 1.3 and reflection performance was not improved until 1.4.
Since the driver still needs to be compatible with 1.2 and 1.3 this class is used
to delegate the calls to the connection with minimal overhead.
- Version:
- $Id: ConnectionProxy.java,v 1.7.2.3 2009-12-30 08:45:34 ickzon Exp $
-
Field Summary
FieldsFields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
ConstructorsConstructorDescriptionConnectionProxy(PooledConnection pooledConnection, Connection connection) Constructs a new connection proxy. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidDelgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidclose()Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidcommit()Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.createArrayOf(String typeName, Object[] elements) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.createStatement(int resultSetType, int resultSetConcurrency) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.createStruct(String typeName, Object[] attributes) protected voidfinalize()Closes the proxy, releasing the connection.booleanDelgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.getClientInfo(String name) intDelgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.intintDelgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.booleanisClosed()Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.booleanDelgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.booleanisValid(int timeout) booleanisWrapperFor(Class arg0) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareCall(String sql) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareCall(String sql, int resultSetType, int resultSetConcurrency) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareStatement(String sql) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareStatement(String sql, int autoGeneratedKeys) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareStatement(String sql, int[] columnIndexes) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareStatement(String sql, int resultSetType, int resultSetConcurrency) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.prepareStatement(String sql, String[] columnNames) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.(package private) voidprocessSQLException(SQLException sqlException) Processes SQLExceptions.voidreleaseSavepoint(Savepoint savepoint) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidrollback()Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidDelgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidsetAutoCommit(boolean autoCommit) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidsetCatalog(String catalog) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidsetClientInfo(String name, String value) voidsetClientInfo(Properties properties) voidsetHoldability(int holdability) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidsetNetworkTimeout(Executor executor, int milliseconds) voidsetReadOnly(boolean readOnly) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.setSavepoint(String name) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidvoidsetTransactionIsolation(int level) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.voidsetTypeMap(Map map) Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.private voidValidates the connection state.Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Field Details
-
_pooledConnection
-
_connection
-
_closed
private boolean _closed
-
-
Constructor Details
-
ConnectionProxy
Constructs a new connection proxy.
-
-
Method Details
-
clearWarnings
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException- if an error occurs
-
close
public void close()Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection
-
commit
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
commitin interfaceConnection- Throws:
SQLException- if an error occurs
-
createStatement
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
createStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
createStatement
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
createStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
createStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
getAutoCommit
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException- if an error occurs
-
getCatalog
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException- if an error occurs
-
getHoldability
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException- if an error occurs
-
getTransactionIsolation
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException- if an error occurs
-
getTypeMap
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException- if an error occurs
-
getWarnings
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException- if an error occurs
-
getMetaData
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException- if an error occurs
-
isClosed
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
isClosedin interfaceConnection- Throws:
SQLException- if an error occurs
-
isReadOnly
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException- if an error occurs
-
nativeSQL
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareCall
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareStatement
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareStatement
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareStatement
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareStatement
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException- if an error occurs
-
releaseSavepoint
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException- if an error occurs
-
rollback
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
rollbackin interfaceConnection- Throws:
SQLException- if an error occurs
-
rollback
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
rollbackin interfaceConnection- Throws:
SQLException- if an error occurs
-
setAutoCommit
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException- if an error occurs
-
setCatalog
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException- if an error occurs
-
setHoldability
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException- if an error occurs
-
setReadOnly
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException- if an error occurs
-
setSavepoint
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException- if an error occurs
-
setSavepoint
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException- if an error occurs
-
setTransactionIsolation
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException- if an error occurs
-
setTypeMap
Delgates calls to the connection; SQLExceptions thrown from the connection will cause an event to be fired on the connection pool listeners.- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException- if an error occurs
-
validateConnection
Validates the connection state.- Throws:
SQLException
-
processSQLException
Processes SQLExceptions.- Throws:
SQLException
-
finalize
protected void finalize()Closes the proxy, releasing the connection. -
createArrayOf
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createBlob
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException
-
createClob
- Specified by:
createClobin interfaceConnection- Throws:
SQLException
-
createNClob
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-
createStruct
- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
isValid
- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
setSchema
- Specified by:
setSchemain interfaceConnection- Throws:
SQLException
-
getSchema
- Specified by:
getSchemain interfaceConnection- Throws:
SQLException
-
abort
- Specified by:
abortin interfaceConnection- Throws:
SQLException
-
setNetworkTimeout
- Specified by:
setNetworkTimeoutin interfaceConnection- Throws:
SQLException
-
getNetworkTimeout
- Specified by:
getNetworkTimeoutin interfaceConnection- Throws:
SQLException
-