Class DruidDataSourceWrapper
java.lang.Object
com.alibaba.druid.pool.WrapperAdapter
com.alibaba.druid.pool.DruidAbstractDataSource
com.alibaba.druid.pool.DruidDataSource
com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper
- All Implemented Interfaces:
DruidAbstractDataSourceMBean,DruidDataSourceMBean,ManagedDataSource,DataSourceProxy,Closeable,Serializable,AutoCloseable,Cloneable,Wrapper,MBeanRegistration,Referenceable,CommonDataSource,ConnectionPoolDataSource,DataSource,org.springframework.beans.factory.InitializingBean
@ConfigurationProperties("spring.datasource.druid")
public class DruidDataSourceWrapper
extends DruidDataSource
implements org.springframework.beans.factory.InitializingBean
- Author:
- lihengming [89921218@qq.com]
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.alibaba.druid.pool.DruidDataSource
DruidDataSource.CreateConnectionTask, DruidDataSource.CreateConnectionThread, DruidDataSource.DestroyConnectionThread, DruidDataSource.DestroyTask, DruidDataSource.LogStatsThreadNested classes/interfaces inherited from class com.alibaba.druid.pool.DruidAbstractDataSource
DruidAbstractDataSource.PhysicalConnectionInfo -
Field Summary
Fields inherited from class com.alibaba.druid.pool.DruidDataSource
checkExecuteTime, connectErrorCountUpdater, createTaskIdSeedUpdater, dataSourceStat, discardErrorCountUpdater, instanceKey, keepAliveCheckErrorCountUpdater, killWhenSocketReadTimeout, recycleErrorCountUpdater, resetCountUpdater, waitNanosLocalFields 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, validationQuery, validationQueryTimeout, validConnectionChecker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidautoAddFilters(List<Filter> filters) voidsetMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) Ignore the 'maxEvictableIdleTimeMillis < minEvictableIdleTimeMillis' validate, it will be validated again inDruidDataSource.init().Methods inherited from class com.alibaba.druid.pool.DruidDataSource
clearStatementCache, clone, cloneDruidDataSource, close, configFromPropeties, configFromPropety, createAndStartCreatorThread, createAndStartDestroyThread, discardConnection, discardConnection, dump, fill, fill, forEach, getActiveCount, getActivePeak, getActivePeakTime, getCloseCount, getConnectCount, getConnectErrorCount, getConnection, getConnection, getConnection, getConnectionDirect, getCreateCount, getDataSourceStat, getDestroyCount, getDiscardCount, getErrorCount, getFilterClassNames, getInitStackTrace, getLock, getLockQueueLength, getNotEmptySignalCount, getNotEmptyWaitCount, getNotEmptyWaitMillis, getNotEmptyWaitNanos, getNotEmptyWaitThreadCount, getNotEmptyWaitThreadPeak, getPooledConnection, getPooledConnection, getPoolingConnectionInfo, getPoolingCount, getPoolingPeak, getPoolingPeakTime, getProperties, getRawDriverMajorVersion, getRawDriverMinorVersion, getRecycleCount, getRecycleErrorCount, getReference, getRemoveAbandonedCount, getResetCount, getSqlStat, getSqlStat, getSqlStatMap, getStatData, getStatDataForMBean, getStatValueAndReset, getVersion, getWaitThreadCount, getWallStatMap, getWallStatValue, handleConnectionException, handleFatalError, init, initCheck, isAsyncInit, isCheckExecuteTime, isClosed, isEnable, isFull, isKeepAlive, isKillWhenSocketReadTimeout, isLogDifferentThread, isMbeanRegistered, isResetStatEnable, isUseGlobalDataSourceStat, isWrapperFor, logStats, logTransaction, postDeregister, postRegister, preDeregister, preRegister, put, recycle, registerMbean, removeAbandoned, resetStat, resolveDriver, restart, restart, setAsyncInit, setCheckExecuteTime, setConnectProperties, setEnable, setKeepAlive, setKillWhenSocketReadTimeout, setLogDifferentThread, setMaxActive, setPoolPreparedStatements, setResetStatEnable, setUseGlobalDataSourceStat, shrink, shrink, shrink, toString, tryGetConnection, unregisterMbean, unwrapMethods inherited from class com.alibaba.druid.pool.DruidAbstractDataSource
addConnectionProperty, addFilters, clearFilters, cloneTo, closePreapredStatement, createChain, createConnectionId, createMetaDataId, createPhysicalConnection, createPhysicalConnection, createResultSetId, createStatementId, createTransactionId, decrementCachedPreparedStatementCount, getActiveConnections, getActiveConnectionStackTrace, getAndResetExecuteCount, getCachedPreparedStatementAccessCount, getCachedPreparedStatementCount, getCachedPreparedStatementDeleteCount, getCachedPreparedStatementHitCount, getCachedPreparedStatementMissCount, getClosedPreparedStatementCount, getCommitCount, getCompositeData, getConnectionErrorRetryAttempts, getConnectionInitSqls, getConnectProperties, getConnectTimeout, getCreatedTime, getCreateErrorCount, getCreateScheduler, getCreateTimespanMillis, getCreateTimespanNano, 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, getValidationQuery, getValidationQueryTimeout, getValidConnectionChecker, getValidConnectionCheckerClassName, handleConnectionException, incrementCachedPreparedStatementCount, incrementCachedPreparedStatementDeleteCount, incrementCachedPreparedStatementHitCount, incrementCachedPreparedStatementMissCount, incrementClosedPreparedStatementCount, incrementCommitCount, incrementDupCloseCount, incrementExecuteBatchCount, incrementExecuteCount, incrementExecuteQueryCount, incrementExecuteUpdateCount, incrementPreparedStatementCount, incrementRollbackCount, incrementStartTransactionCount, initPhysicalConnection, initPhysicalConnection, isAccessToUnderlyingConnectionAllowed, isAsyncCloseConnectionEnable, isBreakAfterAcquireFailure, isClearFiltersEnable, isDefaultAutoCommit, isDupCloseLogEnable, isFailContinuous, isFailFast, isInited, isInitExceptionThrow, isInitGlobalVariants, isInitVariants, 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, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxCreateTaskCount, 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, validateConnectionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLoggerMethods inherited from interface javax.sql.ConnectionPoolDataSource
createPooledConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterMethods inherited from interface javax.sql.DataSource
createConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterMethods 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, setUseOracleImplicitCacheMethods inherited from interface com.alibaba.druid.pool.DruidDataSourceMBean
getObjectName, getTimeBetweenLogStatsMillis, getUrl, setConnectionProperties, setStatLoggerClassName, setTimeBetweenLogStatsMillisMethods inherited from interface com.alibaba.druid.pool.ManagedDataSource
getObjectName, setObjectName
-
Constructor Details
-
DruidDataSourceWrapper
public DruidDataSourceWrapper()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
autoAddFilters
-
setMaxEvictableIdleTimeMillis
public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) Ignore the 'maxEvictableIdleTimeMillis < minEvictableIdleTimeMillis' validate, it will be validated again inDruidDataSource.init().for fix issue #3084, #2763
- Overrides:
setMaxEvictableIdleTimeMillisin classDruidAbstractDataSource- Since:
- 1.1.14
-