Class NewProxyConnection
- All Implemented Interfaces:
C3P0ProxyConnection
,AutoCloseable
,Connection
,Wrapper
-
Field Summary
FieldsFields inherited from interface com.mchange.v2.c3p0.C3P0ProxyConnection
RAW_CONNECTION
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
close()
void
commit()
createArrayOf
(String a, Object[] b) createStatement
(int a, int b) createStatement
(int a, int b, int c) createStruct
(String a, Object[] b) void
boolean
int
int
int
boolean
isClosed()
boolean
boolean
isValid
(int a) boolean
prepareCall
(String a, int b, int c) prepareCall
(String a, int b, int c, int d) prepareStatement
(String a, int b) prepareStatement
(String a, int[] b) prepareStatement
(String a, int b, int c) prepareStatement
(String a, int b, int c, int d) prepareStatement
(String a, String[] b) rawConnectionOperation
(Method m, Object target, Object[] args) Allows one to work with the unproxied, raw Connection.void
void
rollback()
void
void
setAutoCommit
(boolean a) void
setCatalog
(String a) void
setClientInfo
(String a, String b) void
void
setHoldability
(int a) void
setNetworkTimeout
(Executor a, int b) void
setReadOnly
(boolean a) void
void
void
boolean
setShardingKeyIfValid
(ShardingKey a, int b) boolean
setShardingKeyIfValid
(ShardingKey a, ShardingKey b, int c) void
setTransactionIsolation
(int a) void
setTypeMap
(Map a) toString()
-
Field Details
-
inner
-
-
Method Details
-
commit
- Specified by:
commit
in interfaceConnection
- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnly
in interfaceConnection
- Throws:
SQLException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnection
- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnly
in interfaceConnection
- Throws:
SQLException
-
isValid
- Specified by:
isValid
in interfaceConnection
- Throws:
SQLException
-
abort
- Specified by:
abort
in interfaceConnection
- Throws:
SQLException
-
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
createStatement
- Specified by:
createStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatement
in interfaceConnection
- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCall
in interfaceConnection
- Throws:
SQLException
-
getMetaData
- Specified by:
getMetaData
in interfaceConnection
- Throws:
SQLException
-
setTransactionIsolation
- Specified by:
setTransactionIsolation
in interfaceConnection
- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalog
in interfaceConnection
- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldability
in interfaceConnection
- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMap
in interfaceConnection
- Throws:
SQLException
-
getWarnings
- Specified by:
getWarnings
in interfaceConnection
- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarnings
in interfaceConnection
- Throws:
SQLException
-
isClosed
- Specified by:
isClosed
in interfaceConnection
- Throws:
SQLException
-
rollback
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
rollback
- Specified by:
rollback
in interfaceConnection
- Throws:
SQLException
-
setAutoCommit
- Specified by:
setAutoCommit
in interfaceConnection
- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfo
in interfaceConnection
- Throws:
SQLClientInfoException
-
nativeSQL
- Specified by:
nativeSQL
in interfaceConnection
- Throws:
SQLException
-
getAutoCommit
- Specified by:
getAutoCommit
in interfaceConnection
- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalog
in interfaceConnection
- Throws:
SQLException
-
getTransactionIsolation
- Specified by:
getTransactionIsolation
in interfaceConnection
- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMap
in interfaceConnection
- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldability
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepoint
in interfaceConnection
- Throws:
SQLException
-
createClob
- Specified by:
createClob
in interfaceConnection
- Throws:
SQLException
-
createBlob
- Specified by:
createBlob
in interfaceConnection
- Throws:
SQLException
-
createNClob
- Specified by:
createNClob
in interfaceConnection
- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXML
in interfaceConnection
- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfo
in interfaceConnection
- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfo
in interfaceConnection
- Throws:
SQLException
-
createArrayOf
- Specified by:
createArrayOf
in interfaceConnection
- Throws:
SQLException
-
createStruct
- Specified by:
createStruct
in interfaceConnection
- Throws:
SQLException
-
setSchema
- Specified by:
setSchema
in interfaceConnection
- Throws:
SQLException
-
getSchema
- Specified by:
getSchema
in interfaceConnection
- Throws:
SQLException
-
setNetworkTimeout
- Specified by:
setNetworkTimeout
in interfaceConnection
- Throws:
SQLException
-
getNetworkTimeout
- Specified by:
getNetworkTimeout
in interfaceConnection
- Throws:
SQLException
-
beginRequest
- Specified by:
beginRequest
in interfaceConnection
- Throws:
SQLException
-
endRequest
- Specified by:
endRequest
in interfaceConnection
- Throws:
SQLException
-
setShardingKeyIfValid
- Specified by:
setShardingKeyIfValid
in interfaceConnection
- Throws:
SQLException
-
setShardingKeyIfValid
- Specified by:
setShardingKeyIfValid
in interfaceConnection
- Throws:
SQLException
-
setShardingKey
- Specified by:
setShardingKey
in interfaceConnection
- Throws:
SQLException
-
setShardingKey
- Specified by:
setShardingKey
in interfaceConnection
- Throws:
SQLException
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
rawConnectionOperation
public Object rawConnectionOperation(Method m, Object target, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SQLException Description copied from interface:C3P0ProxyConnection
Allows one to work with the unproxied, raw Connection. Some database companies never got over the "common interfaces mean no more vendor lock-in!" thing, and offer non-standard API on their Connections. This method permits you to "pierce" the connection-pooling layer to call non-standard methods on the original Connection, or to pass the original Connections to functions that are not implementation neutral.
To use this functionality, you'll need to cast a Connection retrieved from a c3p0 PooledDataSource to a C3P0ProxyConnection.
This method works by making a reflective call of method m on Object target (which may be null for static methods), passing and argument list args. For the method target, or for any argument, you may substitute the special token C3P0ProxyConnection.RAW_CONNECTION
Any Statements or ResultSets returned by the operation will be proxied and c3p0-managed, meaning that these resources will be automatically closed if the user does not close them first when this Connection is checked back into the pool. Any other resources returned by the operation are the user's responsibility to clean up!
Incautious use of this method can corrupt the Connection pool, by breaking the invariant that all checked-in Connections should be equivalent. If your vendor supplies API that allows you to modify the state or configuration of a Connection in some nonstandard way, you might use this method to do so, and then check the Connection back into the pool. When you fetch another Connection from the PooledDataSource, it will be undefined whether the Connection returned will have your altered configuration, or the default configuration of a "fresh" Connection. Thus, it is inadvisable to use this method to call nonstandard mutators.
- Specified by:
rawConnectionOperation
in interfaceC3P0ProxyConnection
- Throws:
IllegalAccessException
IllegalArgumentException
InvocationTargetException
SQLException
-
toString
-