Package com.alibaba.druid.pool
Class DruidPooledConnection
java.lang.Object
com.alibaba.druid.pool.PoolableWrapper
com.alibaba.druid.pool.DruidPooledConnection
- All Implemented Interfaces:
AutoCloseable,Connection,Wrapper,PooledConnection
- Author:
- wenshao [szujobs@hotmail.com]
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected Connectionprotected StackTraceElement[]protected booleanprotected Throwableprotected FilterChainprotected DruidConnectionHolderstatic final intprotected final Threadprotected booleanprotected TransactionInfoFields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabandond()voidvoidvoidvoidvoidvoidclose()voidvoidcommit()createArrayOf(String typeName, Object[] elements) createStatement(int resultSetType, int resultSetConcurrency) createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) createStruct(String typeName, Object[] attributes) protected voidvoiddisable()voidbooleangetClientInfo(String name) longlonglongintintlonglonginthandleException(Throwable t, String sql) booleanbooleanisClosed()booleanbooleanisOracle()booleanbooleanbooleanisValid(int timeout) prepareCall(String sql) prepareCall(String sql, int resultSetType, int resultSetConcurrency) prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql) prepareStatement(String sql, int autoGeneratedKeys) prepareStatement(String sql, int[] columnIndexes) prepareStatement(String sql, int resultSetType, int resultSetConcurrency) prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) prepareStatement(String sql, String[] columnNames) voidrecycle()voidreleaseSavepoint(Savepoint savepoint) voidvoidvoidrollback()voidvoidsetAutoCommit(boolean autoCommit) voidsetCatalog(String catalog) voidsetClientInfo(String name, String value) voidsetClientInfo(Properties properties) voidvoidsetConnectedTimeNano(long connectedTimeNano) voidsetConnectStackTrace(StackTraceElement[] connectStackTrace) voidsetHoldability(int holdability) voidsetNetworkTimeout(Executor executor, int milliseconds) voidsetReadOnly(boolean readOnly) setSavepoint(String name) voidvoidsetTraceEnable(boolean traceEnable) voidsetTransactionIsolation(int level) voidsetTypeMap(Map<String, Class<?>> map) voidtoString()protected voidtransactionRecord(String sql) Methods inherited from class com.alibaba.druid.pool.PoolableWrapper
isWrapperFor, unwrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValidMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Field Details
-
MAX_RECORD_SQL_COUNT
public static final int MAX_RECORD_SQL_COUNT- See Also:
-
conn
-
holder
-
transactionInfo
-
traceEnable
protected volatile boolean traceEnable -
disable
protected volatile boolean disable -
closed
protected volatile boolean closed -
ownerThread
-
connectStackTrace
-
disableError
-
closing
protected volatile int closing -
filterChain
-
-
Constructor Details
-
DruidPooledConnection
-
-
Method Details
-
getConnectedTimeMillis
public long getConnectedTimeMillis() -
getOwnerThread
-
getConnectStackTrace
-
setConnectStackTrace
-
getConnectedTimeNano
public long getConnectedTimeNano() -
setConnectedTimeNano
public void setConnectedTimeNano() -
setConnectedTimeNano
public void setConnectedTimeNano(long connectedTimeNano) -
isTraceEnable
public boolean isTraceEnable() -
setTraceEnable
public void setTraceEnable(boolean traceEnable) -
handleException
- Throws:
SQLException
-
handleException
- Throws:
SQLException
-
isOracle
public boolean isOracle() -
closePoolableStatement
- Throws:
SQLException
-
getConnectionHolder
-
getConnection
- Specified by:
getConnectionin interfacePooledConnection
-
disable
public void disable() -
disable
-
isDisable
public boolean isDisable() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceConnection- Specified by:
closein interfacePooledConnection- Throws:
SQLException
-
syncClose
- Throws:
SQLException
-
recycle
- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareStatement
- Specified by:
prepareStatementin interfaceConnection- Throws:
SQLException
-
prepareCall
- Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
prepareCall
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException - Specified by:
prepareCallin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException - Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
createStatement
- Specified by:
createStatementin interfaceConnection- Throws:
SQLException
-
nativeSQL
- Specified by:
nativeSQLin interfaceConnection- Throws:
SQLException
-
setAutoCommit
- Specified by:
setAutoCommitin interfaceConnection- Throws:
SQLException
-
transactionRecord
- Throws:
SQLException
-
getAutoCommit
- Specified by:
getAutoCommitin interfaceConnection- Throws:
SQLException
-
commit
- Specified by:
commitin interfaceConnection- Throws:
SQLException
-
getTransactionInfo
-
createTransactionInfo
protected void createTransactionInfo() -
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Throws:
SQLException
-
createClob
- Specified by:
createClobin interfaceConnection- Throws:
SQLException
-
isClosed
- Specified by:
isClosedin interfaceConnection- Throws:
SQLException
-
isAbandonded
public boolean isAbandonded() -
getMetaData
- Specified by:
getMetaDatain interfaceConnection- Throws:
SQLException
-
setReadOnly
- Specified by:
setReadOnlyin interfaceConnection- Throws:
SQLException
-
isReadOnly
- Specified by:
isReadOnlyin interfaceConnection- Throws:
SQLException
-
setCatalog
- Specified by:
setCatalogin interfaceConnection- Throws:
SQLException
-
getCatalog
- Specified by:
getCatalogin interfaceConnection- Throws:
SQLException
-
setTransactionIsolation
- Specified by:
setTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getTransactionIsolation
- Specified by:
getTransactionIsolationin interfaceConnection- Throws:
SQLException
-
getWarnings
- Specified by:
getWarningsin interfaceConnection- Throws:
SQLException
-
clearWarnings
- Specified by:
clearWarningsin interfaceConnection- Throws:
SQLException
-
getTypeMap
- Specified by:
getTypeMapin interfaceConnection- Throws:
SQLException
-
setTypeMap
- Specified by:
setTypeMapin interfaceConnection- Throws:
SQLException
-
setHoldability
- Specified by:
setHoldabilityin interfaceConnection- Throws:
SQLException
-
getHoldability
- Specified by:
getHoldabilityin interfaceConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Throws:
SQLException
-
createBlob
- Specified by:
createBlobin interfaceConnection- Throws:
SQLException
-
createNClob
- Specified by:
createNClobin interfaceConnection- Throws:
SQLException
-
createSQLXML
- Specified by:
createSQLXMLin interfaceConnection- Throws:
SQLException
-
isValid
- Specified by:
isValidin interfaceConnection- Throws:
SQLException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
setClientInfo
- Specified by:
setClientInfoin interfaceConnection- Throws:
SQLClientInfoException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
getClientInfo
- Specified by:
getClientInfoin interfaceConnection- Throws:
SQLException
-
createArrayOf
- Specified by:
createArrayOfin interfaceConnection- Throws:
SQLException
-
createStruct
- Specified by:
createStructin interfaceConnection- Throws:
SQLException
-
addConnectionEventListener
- Specified by:
addConnectionEventListenerin interfacePooledConnection
-
removeConnectionEventListener
- Specified by:
removeConnectionEventListenerin interfacePooledConnection
-
addStatementEventListener
- Specified by:
addStatementEventListenerin interfacePooledConnection
-
removeStatementEventListener
- Specified by:
removeStatementEventListenerin interfacePooledConnection
-
getDisableError
-
checkState
- Throws:
SQLException
-
toString
-
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
-
abandond
public void abandond() -
getPhysicalConnectNanoSpan
public long getPhysicalConnectNanoSpan()- Since:
- 1.0.17
-
getPhysicalConnectionUsedCount
public long getPhysicalConnectionUsedCount()- Since:
- 1.0.17
-
getConnectNotEmptyWaitNanos
public long getConnectNotEmptyWaitNanos()- Since:
- 1.0.17
-
getVariables
- Since:
- 1.0.28
-
getGloablVariables
- Since:
- 1.0.28
-