Package com.alibaba.druid.pool
Class DruidDataSource
- java.lang.Object
-
- com.alibaba.druid.pool.WrapperAdapter
-
- com.alibaba.druid.pool.DruidAbstractDataSource
-
- com.alibaba.druid.pool.DruidDataSource
-
- All Implemented Interfaces:
DruidAbstractDataSourceMBean,DruidDataSourceMBean,ManagedDataSource,DataSourceProxy,DataSourceMonitorable,Closeable,Serializable,AutoCloseable,Cloneable,Wrapper,MBeanRegistration,Referenceable,CommonDataSource,ConnectionPoolDataSource,DataSource
- Direct Known Subclasses:
DruidQuartzConnectionProvider,DruidXADataSource
public class DruidDataSource extends DruidAbstractDataSource implements DruidDataSourceMBean, ManagedDataSource, Referenceable, Closeable, Cloneable, ConnectionPoolDataSource, MBeanRegistration
- Author:
- ljw [ljw2083@alibaba-inc.com], wenshao [szujobs@hotmail.com]
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classDruidDataSource.CreateConnectionTaskclassDruidDataSource.CreateConnectionThreadclassDruidDataSource.DestroyConnectionThreadclassDruidDataSource.DestroyTaskclassDruidDataSource.LogStatsThread-
Nested classes/interfaces inherited from class com.alibaba.druid.pool.DruidAbstractDataSource
DruidAbstractDataSource.PhysicalConnectionInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancheckExecuteTimeprotected static AtomicLongFieldUpdater<DruidDataSource>connectErrorCountUpdaterprotected static AtomicIntegerFieldUpdater<DruidDataSource>createDirectCountUpdaterprotected static AtomicLongFieldUpdater<DruidDataSource>createTaskIdSeedUpdaterprotected JdbcDataSourceStatdataSourceStatprotected static AtomicLongFieldUpdater<DruidDataSource>discardErrorCountUpdaterprotected StringinstanceKeyInstance keyprotected static AtomicIntegerFieldUpdater<DruidDataSource>keepAliveCheckErrorCountUpdaterprotected booleankillWhenSocketReadTimeoutprotected static AtomicLongFieldUpdater<DruidDataSource>recycleErrorCountUpdaterprotected static AtomicLongFieldUpdater<DruidDataSource>resetCountUpdater-
Fields inherited from class com.alibaba.druid.pool.DruidAbstractDataSource
accessToUnderlyingConnectionAllowed, activeConnectionLock, activeConnections, asyncCloseConnectionEnable, breakAfterAcquireFailure, cachedPreparedStatementCount, cachedPreparedStatementDeleteCount, cachedPreparedStatementHitCount, cachedPreparedStatementMissCount, closedPreparedStatementCount, commitCount, connectionErrorRetryAttempts, connectionIdSeed, connectionInitSqls, connectProperties, connectTimeout, createCount, createdTime, createError, createErrorCount, createScheduler, createStartNanos, createTimespan, creatingCount, dbTypeName, DEFAULT_INITIAL_SIZE, DEFAULT_MAX_ACTIVE_SIZE, DEFAULT_MAX_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_MAX_IDLE, DEFAULT_MAX_WAIT, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_MIN_IDLE, DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_PHY_TIMEOUT_MILLIS, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_TIME_CONNECT_TIMEOUT_MILLIS, DEFAULT_TIME_SOCKET_TIMEOUT_MILLIS, DEFAULT_VALIDATION_QUERY, DEFAULT_WHILE_IDLE, defaultAutoCommit, defaultCatalog, defaultReadOnly, defaultTransactionIsolation, destroyCount, destroyScheduler, directCreateCount, driver, driverClass, driverClassLoader, dupCloseCount, empty, errorCount, exceptionSorter, executeBatchCount, executeCount, executeQueryCount, executeUpdateCount, failContinuous, failContinuousTimeMillis, failFast, fatalErrorCount, fatalErrorCountLastShrink, filterChainUpdater, filters, id, inited, initedTime, initExceptionThrow, initGlobalVariants, initialSize, initVariants, isMySql, isOracle, jdbcUrl, keepAliveBetweenTimeMillis, keepAliveError, lastCreateError, lastCreateErrorTimeMillis, lastCreateStartTimeMillis, lastError, lastErrorTimeMillis, lastFatalError, lastFatalErrorSql, lastFatalErrorTimeMillis, lock, logAbandoned, logWriter, maxActive, maxCreateTaskCount, maxEvictableIdleTimeMillis, maxIdle, maxOpenPreparedStatements, maxPoolPreparedStatementPerConnectionSize, maxWait, maxWaitThreadCount, metaDataIdSeed, minEvictableIdleTimeMillis, minIdle, name, netTimeoutError, netTimeoutExecutor, notEmpty, notFullTimeoutRetryCount, numTestsPerEvictionRun, onFatalError, onFatalErrorMaxActive, password, passwordCallback, phyMaxUseCount, phyTimeoutMillis, poolPreparedStatements, preparedStatementCount, PRESENT, queryTimeout, removeAbandoned, removeAbandonedTimeoutMillis, resultSetIdSeed, rollbackCount, sharePreparedStatements, socketTimeout, startTransactionCount, statementIdSeed, statLogger, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenConnectErrorMillis, timeBetweenEvictionRunsMillis, timeBetweenLogStatsMillis, transactionHistogram, transactionIdSeed, transactionQueryTimeout, transactionThresholdMillis, useOracleImplicitCache, usePingMethod, userCallback, username, userPasswordVersion, validationQuery, validationQueryTimeout, validConnectionChecker
-
-
Constructor Summary
Constructors Constructor Description DruidDataSource()DruidDataSource(boolean fairLock)
-
Method Summary
-
Methods inherited from class com.alibaba.druid.pool.DruidAbstractDataSource
addConnectionProperty, addFilters, clearFilters, cloneTo, closePreapredStatement, createChain, createConnectionId, createMetaDataId, createPhysicalConnection, createPhysicalConnection, createResultSetId, createStatementId, createTransactionId, decrementCachedPreparedStatementCount, fillStatDataToMap, getActiveConnections, getActiveConnectionStackTrace, getAndResetExecuteCount, getCachedPreparedStatementAccessCount, getCachedPreparedStatementCount, getCachedPreparedStatementDeleteCount, getCachedPreparedStatementHitCount, getCachedPreparedStatementMissCount, getClosedPreparedStatementCount, getCommitCount, getCompositeData, getConnectionErrorRetryAttempts, getConnectionInitSqls, getConnectProperties, getConnectTimeout, getCreatedTime, getCreateErrorCount, getCreateScheduler, getCreateTimespanMillis, getCreateTimespanNano, getDataSourceId, getDbType, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDestroyScheduler, getDriver, getDriverClassLoader, getDriverClassName, getDriverMajorVersion, getDriverMinorVersion, getDupCloseCount, getExceptionSorter, getExceptionSorterClassName, getExecuteBatchCount, getExecuteCount, getExecuteCount2, getExecuteQueryCount, getExecuteUpdateCount, getFilterClasses, getID, getInitialSize, getKeepAliveBetweenTimeMillis, getLastCreateError, getLastCreateErrorTime, getLastCreateErrorTimeMillis, getLastError, getLastErrorTime, getLastErrorTimeMillis, getLoginTimeout, getLogWriter, getMaxActive, getMaxCreateTaskCount, getMaxEvictableIdleTimeMillis, getMaxIdle, getMaxOpenPreparedStatements, getMaxPoolPreparedStatementPerConnectionSize, getMaxWait, getMaxWaitThreadCount, getMinEvictableIdleTimeMillis, getMinIdle, getName, getNotFullTimeoutRetryCount, getNumTestsPerEvictionRun, getObjectName, getOnFatalErrorMaxActive, getParentLogger, getPassword, getPasswordCallback, getPhyMaxUseCount, getPhyTimeoutMillis, getPreparedStatementCount, getProxyFilters, getQueryTimeout, getRawDriver, getRawJdbcUrl, getRemoveAbandonedTimeout, getRemoveAbandonedTimeoutMillis, getRollbackCount, getSocketTimeout, getStartTransactionCount, getStatLogger, getTimeBetweenConnectErrorMillis, getTimeBetweenEvictionRunsMillis, getTimeBetweenLogStatsMillis, getTransactionHistogram, getTransactionHistogramRanges, getTransactionHistogramValues, getTransactionQueryTimeout, getTransactionThresholdMillis, getUrl, getUserCallback, getUsername, getUserPasswordVersion, getValidationQuery, getValidationQueryTimeout, getValidConnectionChecker, getValidConnectionCheckerClassName, handleConnectionException, incrementCachedPreparedStatementCount, incrementCachedPreparedStatementDeleteCount, incrementCachedPreparedStatementHitCount, incrementCachedPreparedStatementMissCount, incrementClosedPreparedStatementCount, incrementCommitCount, incrementDupCloseCount, incrementExecuteBatchCount, incrementExecuteCount, incrementExecuteQueryCount, incrementExecuteUpdateCount, incrementPreparedStatementCount, incrementRollbackCount, incrementStartTransactionCount, incrementUserPasswordVersion, initPhysicalConnection, initPhysicalConnection, isAccessToUnderlyingConnectionAllowed, isAsyncCloseConnectionEnable, isBreakAfterAcquireFailure, isClearFiltersEnable, isDefaultAutoCommit, isDupCloseLogEnable, isFailContinuous, isFailFast, isInited, isInitExceptionThrow, isInitGlobalVariants, isInitVariants, isKeepConnectionUnderlyingTransactionIsolation, isLogAbandoned, isOnFatalError, isOracle, isPoolPreparedStatements, isRemoveAbandoned, isSharePreparedStatements, isTestOnBorrow, isTestOnReturn, isTestWhileIdle, isUseLocalSessionState, isUseOracleImplicitCache, isUsePingMethod, isUseUnfairLock, recycleFilterChain, setAccessToUnderlyingConnectionAllowed, setAsyncCloseConnectionEnable, setBreakAfterAcquireFailure, setClearFiltersEnable, setConnectionErrorRetryAttempts, setConnectionInitSqls, setConnectionProperties, setConnectTimeout, setConnectTimeout, setCreateError, setCreateScheduler, setDbType, setDbType, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDestroyScheduler, setDriver, setDriverClassLoader, setDriverClassName, setDupCloseLogEnable, setExceptionSorter, setExceptionSorter, setExceptionSorterClassName, setFailContinuous, setFailFast, setFilters, setInitExceptionThrow, setInitGlobalVariants, setInitialSize, setInitVariants, setKeepAliveBetweenTimeMillis, setKeepConnectionUnderlyingTransactionIsolation, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxCreateTaskCount, setMaxEvictableIdleTimeMillis, setMaxIdle, setMaxOpenPreparedStatements, setMaxPoolPreparedStatementPerConnectionSize, setMaxWait, setMaxWaitThreadCount, setMinEvictableIdleTimeMillis, setMinIdle, setName, setNotFullTimeoutRetryCount, setNumTestsPerEvictionRun, setObjectName, setOnFatalErrorMaxActive, setOracle, setPassword, setPasswordCallback, setPasswordCallbackClassName, setPhyMaxUseCount, setPhyTimeoutMillis, setProxyFilters, setQueryTimeout, setRemoveAbandoned, setRemoveAbandonedTimeout, setRemoveAbandonedTimeoutMillis, setSharePreparedStatements, setSocketTimeout, setSocketTimeout, setStatLogger, setStatLoggerClassName, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenConnectErrorMillis, setTimeBetweenEvictionRunsMillis, setTimeBetweenLogStatsMillis, setTransactionQueryTimeout, setTransactionThresholdMillis, setUrl, setUseLocalSessionState, setUseOracleImplicitCache, setUsePingMethod, setUserCallback, setUsername, setUseUnfairLock, setValidationQuery, setValidationQueryTimeout, setValidConnectionChecker, setValidConnectionCheckerClassName, testConnectionInternal, testConnectionInternal, validateConnection
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLogger
-
Methods inherited from interface javax.sql.ConnectionPoolDataSource
createPooledConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface com.alibaba.druid.pool.DruidAbstractDataSourceMBean
getActiveConnectionStackTrace, getCachedPreparedStatementAccessCount, getCachedPreparedStatementCount, getCachedPreparedStatementDeleteCount, getCachedPreparedStatementHitCount, getCachedPreparedStatementMissCount, getClosedPreparedStatementCount, getCommitCount, getConnectionErrorRetryAttempts, getCreatedTime, getCreateErrorCount, getCreateTimespanMillis, getDbType, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDriverClassName, getDriverMajorVersion, getDriverMinorVersion, getDupCloseCount, getExceptionSorterClassName, getInitialSize, getLoginTimeout, getMaxActive, getMaxIdle, getMaxOpenPreparedStatements, getMaxPoolPreparedStatementPerConnectionSize, getMaxWait, getMaxWaitThreadCount, getMinEvictableIdleTimeMillis, getMinIdle, getName, getPreparedStatementCount, getQueryTimeout, getRemoveAbandonedTimeoutMillis, getRollbackCount, getStartTransactionCount, getTimeBetweenConnectErrorMillis, getTimeBetweenEvictionRunsMillis, getTransactionHistogramValues, getTransactionQueryTimeout, getTransactionThresholdMillis, getUsername, getValidationQuery, getValidationQueryTimeout, getValidConnectionCheckerClassName, isBreakAfterAcquireFailure, isDefaultAutoCommit, isLogAbandoned, isPoolPreparedStatements, isRemoveAbandoned, isSharePreparedStatements, isTestOnBorrow, isTestOnReturn, isTestWhileIdle, isUseOracleImplicitCache, setLogAbandoned, setMaxPoolPreparedStatementPerConnectionSize, setTestOnBorrow, setTestWhileIdle, setTransactionThresholdMillis, setUseOracleImplicitCache
-
Methods inherited from interface com.alibaba.druid.pool.DruidDataSourceMBean
getObjectName, getTimeBetweenLogStatsMillis, getUrl, setConnectionProperties, setStatLoggerClassName, setTimeBetweenLogStatsMillis
-
Methods inherited from interface com.alibaba.druid.pool.ManagedDataSource
getObjectName, setObjectName
-
-
-
-
Field Detail
-
dataSourceStat
protected JdbcDataSourceStat dataSourceStat
-
killWhenSocketReadTimeout
protected boolean killWhenSocketReadTimeout
-
checkExecuteTime
protected boolean checkExecuteTime
-
recycleErrorCountUpdater
protected static final AtomicLongFieldUpdater<DruidDataSource> recycleErrorCountUpdater
-
connectErrorCountUpdater
protected static final AtomicLongFieldUpdater<DruidDataSource> connectErrorCountUpdater
-
resetCountUpdater
protected static final AtomicLongFieldUpdater<DruidDataSource> resetCountUpdater
-
createTaskIdSeedUpdater
protected static final AtomicLongFieldUpdater<DruidDataSource> createTaskIdSeedUpdater
-
discardErrorCountUpdater
protected static final AtomicLongFieldUpdater<DruidDataSource> discardErrorCountUpdater
-
keepAliveCheckErrorCountUpdater
protected static final AtomicIntegerFieldUpdater<DruidDataSource> keepAliveCheckErrorCountUpdater
-
createDirectCountUpdater
protected static final AtomicIntegerFieldUpdater<DruidDataSource> createDirectCountUpdater
-
instanceKey
protected String instanceKey
Instance key
-
-
Method Detail
-
isAsyncInit
public boolean isAsyncInit()
-
setAsyncInit
public void setAsyncInit(boolean asyncInit)
-
configFromPropety
@Deprecated public void configFromPropety(Properties properties)
Deprecated.
-
configFromPropeties
@Deprecated public void configFromPropeties(Properties properties)
Deprecated.
-
configFromProperties
public void configFromProperties(Properties properties)
support config after init
-
isKillWhenSocketReadTimeout
public boolean isKillWhenSocketReadTimeout()
-
setKillWhenSocketReadTimeout
public void setKillWhenSocketReadTimeout(boolean killWhenSocketTimeOut)
-
isUseGlobalDataSourceStat
public boolean isUseGlobalDataSourceStat()
- Specified by:
isUseGlobalDataSourceStatin interfaceDruidDataSourceMBean
-
setUseGlobalDataSourceStat
public void setUseGlobalDataSourceStat(boolean useGlobalDataSourceStat)
-
isKeepAlive
public boolean isKeepAlive()
-
setKeepAlive
public void setKeepAlive(boolean keepAlive)
-
getInitStackTrace
public String getInitStackTrace()
- Specified by:
getInitStackTracein interfaceDataSourceMonitorable
-
isResetStatEnable
public boolean isResetStatEnable()
- Specified by:
isResetStatEnablein interfaceDruidDataSourceMBean
-
setResetStatEnable
public void setResetStatEnable(boolean resetStatEnable)
- Specified by:
setResetStatEnablein interfaceDruidDataSourceMBean
-
getDiscardCount
public long getDiscardCount()
- Specified by:
getDiscardCountin interfaceDruidDataSourceMBean
-
restart
public void restart() throws SQLException- Throws:
SQLException
-
restart
public void restart(Properties properties) throws SQLException
- Throws:
SQLException
-
resetStat
public void resetStat()
- Specified by:
resetStatin interfaceDataSourceMonitorable- Specified by:
resetStatin interfaceDruidDataSourceMBean
-
getResetCount
public long getResetCount()
- Specified by:
getResetCountin interfaceDruidDataSourceMBean
-
isEnable
public boolean isEnable()
- Specified by:
isEnablein interfaceDruidDataSourceMBean- Specified by:
isEnablein interfaceManagedDataSource
-
setEnable
public void setEnable(boolean enable)
- Specified by:
setEnablein interfaceManagedDataSource
-
setPoolPreparedStatements
public void setPoolPreparedStatements(boolean value)
- Specified by:
setPoolPreparedStatementsin interfaceDruidDataSourceMBean- Specified by:
setPoolPreparedStatementsin classDruidAbstractDataSource
-
setMaxActive
public void setMaxActive(int maxActive)
- Specified by:
setMaxActivein interfaceDruidAbstractDataSourceMBean- Specified by:
setMaxActivein classDruidAbstractDataSource
-
setConnectProperties
public void setConnectProperties(Properties properties)
- Specified by:
setConnectPropertiesin classDruidAbstractDataSource
-
init
public void init() throws SQLException- Throws:
SQLException
-
createAndStartDestroyThread
protected void createAndStartDestroyThread()
-
createAndStartCreatorThread
protected void createAndStartCreatorThread()
-
resolveDriver
protected void resolveDriver() throws SQLException- Throws:
SQLException
-
initCheck
protected void initCheck() throws SQLException- Throws:
SQLException
-
getConnection
public DruidPooledConnection getConnection() throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
public DruidPooledConnection getConnection(long maxWaitMillis) throws SQLException
- Throws:
SQLException
-
getPooledConnection
public PooledConnection getPooledConnection() throws SQLException
- Specified by:
getPooledConnectionin interfaceConnectionPoolDataSource- Throws:
SQLException
-
getPooledConnection
public PooledConnection getPooledConnection(String user, String password) throws SQLException
- Specified by:
getPooledConnectionin interfaceConnectionPoolDataSource- Throws:
SQLException
-
getConnectionDirect
public DruidPooledConnection getConnectionDirect(long maxWaitMillis) throws SQLException
- Throws:
SQLException
-
discardConnection
public boolean discardConnection(Connection conn)
Deprecated.抛弃连接,不进行回收,而是抛弃- Specified by:
discardConnectionin classDruidAbstractDataSource- Parameters:
conn- the connection to be discarded- Returns:
- a boolean indicating whether the empty signal was called
-
discardConnection
public boolean discardConnection(DruidConnectionHolder holder)
- Overrides:
discardConnectionin classDruidAbstractDataSource
-
handleConnectionException
public void handleConnectionException(DruidPooledConnection pooledConnection, Throwable t, String sql) throws SQLException
- Specified by:
handleConnectionExceptionin classDruidAbstractDataSource- Throws:
SQLException
-
handleFatalError
protected final void handleFatalError(DruidPooledConnection conn, SQLException error, String sql) throws SQLException
- Throws:
SQLException
-
recycle
protected void recycle(DruidPooledConnection pooledConnection) throws SQLException
回收连接- Specified by:
recyclein classDruidAbstractDataSource- Throws:
SQLException
-
getRecycleErrorCount
public long getRecycleErrorCount()
-
clearStatementCache
public void clearStatementCache() throws SQLException- Specified by:
clearStatementCachein interfaceDruidDataSourceMBean- Throws:
SQLException
-
close
public void close()
close datasource- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
registerMbean
public void registerMbean()
-
unregisterMbean
public void unregisterMbean()
-
isMbeanRegistered
public boolean isMbeanRegistered()
-
getConnection
public Connection getConnection(String username, String password) throws SQLException
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getCreateCount
public long getCreateCount()
- Specified by:
getCreateCountin interfaceDruidAbstractDataSourceMBean
-
getDestroyCount
public long getDestroyCount()
- Specified by:
getDestroyCountin interfaceDruidAbstractDataSourceMBean
-
getConnectCount
public long getConnectCount()
- Specified by:
getConnectCountin interfaceDruidAbstractDataSourceMBean
-
getCloseCount
public long getCloseCount()
- Specified by:
getCloseCountin interfaceDruidAbstractDataSourceMBean
-
getConnectErrorCount
public long getConnectErrorCount()
- Specified by:
getConnectErrorCountin interfaceDruidAbstractDataSourceMBean
-
getPoolingCount
public int getPoolingCount()
- Specified by:
getPoolingCountin interfaceDruidAbstractDataSourceMBean
-
getPoolingPeak
public int getPoolingPeak()
- Specified by:
getPoolingPeakin interfaceDruidDataSourceMBean
-
getPoolingPeakTime
public Date getPoolingPeakTime()
- Specified by:
getPoolingPeakTimein interfaceDruidDataSourceMBean
-
getRecycleCount
public long getRecycleCount()
- Specified by:
getRecycleCountin interfaceDruidAbstractDataSourceMBean
-
getActiveCount
public int getActiveCount()
- Specified by:
getActiveCountin interfaceDruidAbstractDataSourceMBean
-
logStats
public void logStats()
-
getStatValueAndReset
public DruidDataSourceStatValue getStatValueAndReset()
-
getRemoveAbandonedCount
public long getRemoveAbandonedCount()
- Specified by:
getRemoveAbandonedCountin interfaceDruidAbstractDataSourceMBean
-
put
protected boolean put(DruidAbstractDataSource.PhysicalConnectionInfo physicalConnectionInfo)
-
removeAbandoned
public int removeAbandoned()
- Specified by:
removeAbandonedin interfaceDruidDataSourceMBean
-
getReference
public Reference getReference() throws NamingException
- Specified by:
getReferencein interfaceReferenceable- Throws:
NamingException
-
getFilterClassNames
public List<String> getFilterClassNames()
- Specified by:
getFilterClassNamesin interfaceDruidAbstractDataSourceMBean
-
getRawDriverMajorVersion
public int getRawDriverMajorVersion()
- Specified by:
getRawDriverMajorVersionin interfaceDruidAbstractDataSourceMBean- Specified by:
getRawDriverMajorVersionin classDruidAbstractDataSource
-
getRawDriverMinorVersion
public int getRawDriverMinorVersion()
- Specified by:
getRawDriverMinorVersionin interfaceDruidAbstractDataSourceMBean- Specified by:
getRawDriverMinorVersionin classDruidAbstractDataSource
-
getProperties
public String getProperties()
- Specified by:
getPropertiesin interfaceDruidAbstractDataSourceMBean- Specified by:
getPropertiesin classDruidAbstractDataSource
-
shrink
public void shrink()
- Specified by:
shrinkin interfaceDruidDataSourceMBean
-
shrink
public void shrink(boolean checkTime)
-
shrink
public void shrink(boolean checkTime, boolean keepAlive)
-
getWaitThreadCount
public int getWaitThreadCount()
- Specified by:
getWaitThreadCountin interfaceDruidDataSourceMBean
-
getNotEmptyWaitCount
public long getNotEmptyWaitCount()
- Specified by:
getNotEmptyWaitCountin interfaceDruidDataSourceMBean
-
getNotEmptyWaitThreadCount
public int getNotEmptyWaitThreadCount()
- Specified by:
getNotEmptyWaitThreadCountin interfaceDruidDataSourceMBean
-
getNotEmptyWaitThreadPeak
public int getNotEmptyWaitThreadPeak()
-
getNotEmptySignalCount
public long getNotEmptySignalCount()
- Specified by:
getNotEmptySignalCountin interfaceDruidDataSourceMBean
-
getNotEmptyWaitMillis
public long getNotEmptyWaitMillis()
- Specified by:
getNotEmptyWaitMillisin interfaceDruidDataSourceMBean
-
getNotEmptyWaitNanos
public long getNotEmptyWaitNanos()
- Specified by:
getNotEmptyWaitNanosin interfaceDruidDataSourceMBean
-
getLockQueueLength
public int getLockQueueLength()
- Specified by:
getLockQueueLengthin interfaceDruidDataSourceMBean
-
getActivePeak
public int getActivePeak()
- Specified by:
getActivePeakin interfaceDruidDataSourceMBean- Specified by:
getActivePeakin classDruidAbstractDataSource
-
getActivePeakTime
public Date getActivePeakTime()
- Specified by:
getActivePeakTimein interfaceDruidDataSourceMBean
-
dump
public String dump()
- Specified by:
dumpin interfaceDruidDataSourceMBean
-
getErrorCount
public long getErrorCount()
- Specified by:
getErrorCountin interfaceDruidDataSourceMBean
-
getPoolingConnectionInfo
public List<Map<String,Object>> getPoolingConnectionInfo()
- Specified by:
getPoolingConnectionInfoin interfaceDataSourceMonitorable
-
logTransaction
public void logTransaction(TransactionInfo info)
- Specified by:
logTransactionin classDruidAbstractDataSource
-
getVersion
public String getVersion()
- Specified by:
getVersionin interfaceDruidDataSourceMBean
-
getDataSourceStat
public JdbcDataSourceStat getDataSourceStat()
- Specified by:
getDataSourceStatin interfaceDataSourceProxy
-
cloneDruidDataSource
public DruidDataSource cloneDruidDataSource()
-
getSqlStat
public JdbcSqlStat getSqlStat(int sqlId)
-
getSqlStat
public JdbcSqlStat getSqlStat(long sqlId)
-
getSqlStatMap
public Map<String,JdbcSqlStat> getSqlStatMap()
-
getWallStatValue
public WallProviderStatValue getWallStatValue(boolean reset)
-
getLock
public Lock getLock()
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface)
- Specified by:
isWrapperForin interfaceWrapper- Overrides:
isWrapperForin classWrapperAdapter
-
unwrap
public <T> T unwrap(Class<T> iface)
- Specified by:
unwrapin interfaceWrapper- Overrides:
unwrapin classWrapperAdapter
-
isLogDifferentThread
public boolean isLogDifferentThread()
-
setLogDifferentThread
public void setLogDifferentThread(boolean logDifferentThread)
-
tryGetConnection
public DruidPooledConnection tryGetConnection() throws SQLException
- Throws:
SQLException
-
fill
public int fill() throws SQLException- Specified by:
fillin interfaceDruidDataSourceMBean- Throws:
SQLException
-
fill
public int fill(int toCount) throws SQLException- Specified by:
fillin interfaceDruidDataSourceMBean- Throws:
SQLException
-
isFull
public boolean isFull()
-
preRegister
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
- Specified by:
preRegisterin interfaceMBeanRegistration- Throws:
Exception
-
postRegister
public void postRegister(Boolean registrationDone)
- Specified by:
postRegisterin interfaceMBeanRegistration
-
preDeregister
public void preDeregister() throws Exception- Specified by:
preDeregisterin interfaceMBeanRegistration- Throws:
Exception
-
postDeregister
public void postDeregister()
- Specified by:
postDeregisterin interfaceMBeanRegistration
-
isClosed
public boolean isClosed()
-
isCheckExecuteTime
public boolean isCheckExecuteTime()
-
setCheckExecuteTime
public void setCheckExecuteTime(boolean checkExecuteTime)
-
isLoadSpifilterSkip
public boolean isLoadSpifilterSkip()
-
setLoadSpifilterSkip
public void setLoadSpifilterSkip(boolean loadSpifilterSkip)
-
forEach
public void forEach(Connection conn)
-
-