Class DruidAbstractDataSource

java.lang.Object
com.alibaba.druid.pool.WrapperAdapter
com.alibaba.druid.pool.DruidAbstractDataSource
All Implemented Interfaces:
DruidAbstractDataSourceMBean, DataSourceProxy, Serializable, Wrapper, CommonDataSource, DataSource
Direct Known Subclasses:
DruidDataSource

public abstract class DruidAbstractDataSource extends WrapperAdapter implements DruidAbstractDataSourceMBean, DataSource, DataSourceProxy, Serializable
Author:
wenshao [[email protected]], ljw [[email protected]]
See Also:
  • Field Details

    • DEFAULT_INITIAL_SIZE

      public static final int DEFAULT_INITIAL_SIZE
      See Also:
    • DEFAULT_MAX_ACTIVE_SIZE

      public static final int DEFAULT_MAX_ACTIVE_SIZE
      See Also:
    • DEFAULT_MAX_IDLE

      public static final int DEFAULT_MAX_IDLE
      See Also:
    • DEFAULT_MIN_IDLE

      public static final int DEFAULT_MIN_IDLE
      See Also:
    • DEFAULT_MAX_WAIT

      public static final int DEFAULT_MAX_WAIT
      See Also:
    • DEFAULT_VALIDATION_QUERY

      public static final String DEFAULT_VALIDATION_QUERY
    • DEFAULT_TEST_ON_BORROW

      public static final boolean DEFAULT_TEST_ON_BORROW
      See Also:
    • DEFAULT_TEST_ON_RETURN

      public static final boolean DEFAULT_TEST_ON_RETURN
      See Also:
    • DEFAULT_WHILE_IDLE

      public static final boolean DEFAULT_WHILE_IDLE
      See Also:
    • DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS

      public static final long DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS
      See Also:
    • DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS

      public static final long DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS
      See Also:
    • DEFAULT_NUM_TESTS_PER_EVICTION_RUN

      public static final int DEFAULT_NUM_TESTS_PER_EVICTION_RUN
      See Also:
    • DEFAULT_TIME_CONNECT_TIMEOUT_MILLIS

      public static final int DEFAULT_TIME_CONNECT_TIMEOUT_MILLIS
      See Also:
    • DEFAULT_TIME_SOCKET_TIMEOUT_MILLIS

      public static final int DEFAULT_TIME_SOCKET_TIMEOUT_MILLIS
      See Also:
    • DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS

      public static final long DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS
      See Also:
    • DEFAULT_MAX_EVICTABLE_IDLE_TIME_MILLIS

      public static final long DEFAULT_MAX_EVICTABLE_IDLE_TIME_MILLIS
      See Also:
    • DEFAULT_PHY_TIMEOUT_MILLIS

      public static final long DEFAULT_PHY_TIMEOUT_MILLIS
      See Also:
    • defaultAutoCommit

      protected volatile boolean defaultAutoCommit
    • defaultReadOnly

      protected volatile Boolean defaultReadOnly
    • defaultTransactionIsolation

      protected volatile Integer defaultTransactionIsolation
    • defaultCatalog

      protected volatile String defaultCatalog
    • name

      protected String name
    • username

      protected volatile String username
    • password

      protected volatile String password
    • jdbcUrl

      protected volatile String jdbcUrl
    • driverClass

      protected volatile String driverClass
    • driverClassLoader

      protected volatile ClassLoader driverClassLoader
    • connectProperties

      protected volatile Properties connectProperties
    • passwordCallback

      protected volatile PasswordCallback passwordCallback
    • userCallback

      protected volatile NameCallback userCallback
    • initialSize

      protected volatile int initialSize
    • maxActive

      protected volatile int maxActive
    • minIdle

      protected volatile int minIdle
    • maxIdle

      protected volatile int maxIdle
    • maxWait

      protected volatile long maxWait
    • notFullTimeoutRetryCount

      protected int notFullTimeoutRetryCount
    • validationQuery

      protected volatile String validationQuery
    • validationQueryTimeout

      protected volatile int validationQueryTimeout
    • testOnBorrow

      protected volatile boolean testOnBorrow
    • testOnReturn

      protected volatile boolean testOnReturn
    • testWhileIdle

      protected volatile boolean testWhileIdle
    • poolPreparedStatements

      protected volatile boolean poolPreparedStatements
    • sharePreparedStatements

      protected volatile boolean sharePreparedStatements
    • maxPoolPreparedStatementPerConnectionSize

      protected volatile int maxPoolPreparedStatementPerConnectionSize
    • inited

      protected volatile boolean inited
    • initExceptionThrow

      protected volatile boolean initExceptionThrow
    • logWriter

      protected PrintWriter logWriter
    • filters

      protected List<Filter> filters
    • exceptionSorter

      protected volatile ExceptionSorter exceptionSorter
    • driver

      protected Driver driver
    • connectTimeout

      protected volatile int connectTimeout
    • socketTimeout

      protected volatile int socketTimeout
    • queryTimeout

      protected volatile int queryTimeout
    • transactionQueryTimeout

      protected volatile int transactionQueryTimeout
    • createTimespan

      protected long createTimespan
    • maxWaitThreadCount

      protected volatile int maxWaitThreadCount
    • accessToUnderlyingConnectionAllowed

      protected volatile boolean accessToUnderlyingConnectionAllowed
    • timeBetweenEvictionRunsMillis

      protected volatile long timeBetweenEvictionRunsMillis
    • numTestsPerEvictionRun

      protected volatile int numTestsPerEvictionRun
    • minEvictableIdleTimeMillis

      protected volatile long minEvictableIdleTimeMillis
    • maxEvictableIdleTimeMillis

      protected volatile long maxEvictableIdleTimeMillis
    • keepAliveBetweenTimeMillis

      protected volatile long keepAliveBetweenTimeMillis
    • phyTimeoutMillis

      protected volatile long phyTimeoutMillis
    • phyMaxUseCount

      protected volatile long phyMaxUseCount
    • removeAbandoned

      protected volatile boolean removeAbandoned
    • removeAbandonedTimeoutMillis

      protected volatile long removeAbandonedTimeoutMillis
    • logAbandoned

      protected volatile boolean logAbandoned
    • maxOpenPreparedStatements

      protected volatile int maxOpenPreparedStatements
    • connectionInitSqls

      protected volatile List<String> connectionInitSqls
    • dbTypeName

      protected volatile String dbTypeName
    • timeBetweenConnectErrorMillis

      protected volatile long timeBetweenConnectErrorMillis
    • validConnectionChecker

      protected volatile ValidConnectionChecker validConnectionChecker
    • usePingMethod

      protected volatile boolean usePingMethod
    • activeConnections

      protected final Map<DruidPooledConnection,Object> activeConnections
    • PRESENT

      protected static final Object PRESENT
    • id

      protected long id
    • connectionErrorRetryAttempts

      protected int connectionErrorRetryAttempts
    • breakAfterAcquireFailure

      protected boolean breakAfterAcquireFailure
    • transactionThresholdMillis

      protected long transactionThresholdMillis
    • createdTime

      protected final Date createdTime
    • initedTime

      protected Date initedTime
    • errorCount

      protected volatile long errorCount
    • dupCloseCount

      protected volatile long dupCloseCount
    • startTransactionCount

      protected volatile long startTransactionCount
    • commitCount

      protected volatile long commitCount
    • rollbackCount

      protected volatile long rollbackCount
    • cachedPreparedStatementHitCount

      protected volatile long cachedPreparedStatementHitCount
    • preparedStatementCount

      protected volatile long preparedStatementCount
    • closedPreparedStatementCount

      protected volatile long closedPreparedStatementCount
    • cachedPreparedStatementCount

      protected volatile long cachedPreparedStatementCount
    • cachedPreparedStatementDeleteCount

      protected volatile long cachedPreparedStatementDeleteCount
    • cachedPreparedStatementMissCount

      protected volatile long cachedPreparedStatementMissCount
    • transactionHistogram

      protected final Histogram transactionHistogram
    • executeCount

      protected volatile long executeCount
    • executeQueryCount

      protected volatile long executeQueryCount
    • executeUpdateCount

      protected volatile long executeUpdateCount
    • executeBatchCount

      protected volatile long executeBatchCount
    • createError

      protected volatile Throwable createError
    • lastError

      protected volatile Throwable lastError
    • lastErrorTimeMillis

      protected volatile long lastErrorTimeMillis
    • lastCreateError

      protected volatile Throwable lastCreateError
    • lastCreateErrorTimeMillis

      protected volatile long lastCreateErrorTimeMillis
    • lastCreateStartTimeMillis

      protected volatile long lastCreateStartTimeMillis
    • isOracle

      protected boolean isOracle
    • isMySql

      protected boolean isMySql
    • useOracleImplicitCache

      protected boolean useOracleImplicitCache
    • lock

      protected ReentrantLock lock
    • notEmpty

      protected Condition notEmpty
    • empty

      protected Condition empty
    • activeConnectionLock

      protected ReentrantLock activeConnectionLock
    • createErrorCount

      protected volatile int createErrorCount
    • creatingCount

      protected volatile int creatingCount
    • directCreateCount

      protected volatile int directCreateCount
    • createCount

      protected volatile long createCount
    • destroyCount

      protected volatile long destroyCount
    • createStartNanos

      protected volatile long createStartNanos
    • timeBetweenLogStatsMillis

      protected long timeBetweenLogStatsMillis
    • statLogger

      protected DruidDataSourceStatLogger statLogger
    • maxCreateTaskCount

      protected int maxCreateTaskCount
    • failFast

      protected boolean failFast
    • failContinuous

      protected volatile int failContinuous
    • failContinuousTimeMillis

      protected volatile long failContinuousTimeMillis
    • destroyScheduler

      protected ScheduledExecutorService destroyScheduler
    • createScheduler

      protected ScheduledExecutorService createScheduler
    • netTimeoutExecutor

      protected Executor netTimeoutExecutor
    • netTimeoutError

      protected volatile boolean netTimeoutError
    • initVariants

      protected boolean initVariants
    • initGlobalVariants

      protected boolean initGlobalVariants
    • onFatalError

      protected volatile boolean onFatalError
    • onFatalErrorMaxActive

      protected volatile int onFatalErrorMaxActive
    • fatalErrorCount

      protected volatile int fatalErrorCount
    • fatalErrorCountLastShrink

      protected volatile int fatalErrorCountLastShrink
    • lastFatalErrorTimeMillis

      protected volatile long lastFatalErrorTimeMillis
    • lastFatalErrorSql

      protected volatile String lastFatalErrorSql
    • lastFatalError

      protected volatile Throwable lastFatalError
    • keepAliveError

      protected volatile Throwable keepAliveError
    • connectionIdSeed

      protected volatile long connectionIdSeed
    • statementIdSeed

      protected volatile long statementIdSeed
    • resultSetIdSeed

      protected volatile long resultSetIdSeed
    • transactionIdSeed

      protected volatile long transactionIdSeed
    • metaDataIdSeed

      protected volatile long metaDataIdSeed
  • Constructor Details

    • DruidAbstractDataSource

      public DruidAbstractDataSource(boolean lockFair)
  • Method Details