public class DruidDataSource extends DruidAbstractDataSource implements DruidDataSourceMBean, ManagedDataSource, Referenceable, Closeable, Cloneable, ConnectionPoolDataSource, MBeanRegistration
限定符和类型 | 类和说明 |
---|---|
class |
DruidDataSource.CreateConnectionTask |
class |
DruidDataSource.CreateConnectionThread |
class |
DruidDataSource.DestroyConnectionThread |
class |
DruidDataSource.DestroyTask |
class |
DruidDataSource.LogStatsThread |
限定符和类型 | 字段和说明 |
---|---|
static ThreadLocal<Long> |
waitNanosLocal |
DEFAULT_INITIAL_SIZE, DEFAULT_MAX_ACTIVE_SIZE, DEFAULT_MAX_IDLE, DEFAULT_MAX_WAIT, DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS, DEFAULT_MIN_IDLE, DEFAULT_NUM_TESTS_PER_EVICTION_RUN, DEFAULT_TEST_ON_BORROW, DEFAULT_TEST_ON_RETURN, DEFAULT_TIME_BETWEEN_CONNECT_ERROR_MILLIS, DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS, DEFAULT_VALIDATION_QUERY, DEFAULT_WHILE_IDLE
构造器和说明 |
---|
DruidDataSource() |
DruidDataSource(boolean fairLock) |
addConnectionProperty, addFilters, clearFilters, closePreapredStatement, createConnectionId, createMetaDataId, createPhysicalConnection, createPhysicalConnection, createResultSetId, createStatementId, createTransactionId, decrementCachedPreparedStatementCount, getActiveConnections, getActiveConnectionStackTrace, getCachedPreparedStatementAccessCount, getCachedPreparedStatementCount, getCachedPreparedStatementDeleteCount, getCachedPreparedStatementHitCount, getCachedPreparedStatementMissCount, getClosedPreparedStatementCount, getCommitCount, getCompositeData, getConnectionErrorRetryAttempts, getConnectionInitSqls, getConnectProperties, getCreatedTime, getCreateErrorCount, getCreateScheduler, getCreateTimespanMillis, getCreateTimespanNano, getDbType, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getDestroyScheduler, getDriver, getDriverClassLoader, getDriverClassName, getDriverMajorVersion, getDriverMinorVersion, getDupCloseCount, getExceptionSorter, getExceptionSorterClassName, getExecuteCount, getFilterClasses, getID, getInitialSize, getLastCreateError, getLastCreateErrorTime, getLastCreateErrorTimeMillis, getLastError, getLastErrorTime, getLastErrorTimeMillis, getLoginTimeout, getLogWriter, getMaxActive, getMaxCreateTaskCount, getMaxIdle, getMaxOpenPreparedStatements, getMaxPoolPreparedStatementPerConnectionSize, getMaxWait, getMaxWaitThreadCount, getMinEvictableIdleTimeMillis, getMinIdle, getName, getNotFullTimeoutRetryCount, getNumTestsPerEvictionRun, getObjectName, getParentLogger, getPassword, getPasswordCallback, getPreparedStatementCount, getProxyFilters, getQueryTimeout, getRawDriver, getRawJdbcUrl, getRemoveAbandonedTimeout, getRemoveAbandonedTimeoutMillis, getRollbackCount, getStartTransactionCount, getStatLogger, getTimeBetweenConnectErrorMillis, getTimeBetweenEvictionRunsMillis, getTimeBetweenLogStatsMillis, getTransactionHistogram, getTransactionHistogramRanges, getTransactionHistogramValues, getTransactionQueryTimeout, getTransactionThresholdMillis, getUrl, getUserCallback, getUsername, getValidationQuery, getValidationQueryTimeout, getValidConnectionChecker, getValidConnectionCheckerClassName, incrementCachedPreparedStatementCount, incrementCachedPreparedStatementDeleteCount, incrementCachedPreparedStatementHitCount, incrementCachedPreparedStatementMissCount, incrementClosedPreparedStatementCount, incrementCommitCount, incrementDupCloseCount, incrementExecuteCount, incrementPreparedStatementCount, incrementRollbackCount, incrementStartTransactionCount, initPhysicalConnection, isAccessToUnderlyingConnectionAllowed, isAsyncCloseConnectionEnable, isBreakAfterAcquireFailure, isClearFiltersEnable, isDefaultAutoCommit, isDupCloseLogEnable, isInited, isLogAbandoned, isOracle, isPoolPreparedStatements, isRemoveAbandoned, isSharePreparedStatements, isTestOnBorrow, isTestOnReturn, isTestWhileIdle, isUseLocalSessionState, isUseOracleImplicitCache, isUseUnfairLock, setAccessToUnderlyingConnectionAllowed, setAsyncCloseConnectionEnable, setBreakAfterAcquireFailure, setClearFiltersEnable, setConnectionErrorRetryAttempts, setConnectionInitSqls, setConnectionProperties, setCreateScheduler, setDbType, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDestroyScheduler, setDriver, setDriverClassLoader, setDriverClassName, setDupCloseLogEnable, setExceptionSorter, setExceptionSorter, setExceptionSorterClassName, setFilters, setInitialSize, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxCreateTaskCount, setMaxIdle, setMaxOpenPreparedStatements, setMaxPoolPreparedStatementPerConnectionSize, setMaxWait, setMaxWaitThreadCount, setMinEvictableIdleTimeMillis, setMinIdle, setName, setNotFullTimeoutRetryCount, setNumTestsPerEvictionRun, setObjectName, setOracle, setPassword, setPasswordCallback, setPasswordCallbackClassName, setProxyFilters, setQueryTimeout, setRemoveAbandoned, setRemoveAbandonedTimeout, setRemoveAbandonedTimeoutMillis, setSharePreparedStatements, setStatLogger, setStatLoggerClassName, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenConnectErrorMillis, setTimeBetweenEvictionRunsMillis, setTimeBetweenLogStatsMillis, setTransactionQueryTimeout, setTransactionThresholdMillis, setUrl, setUseLocalSessionState, setUseOracleImplicitCache, setUserCallback, setUsername, setUseUnfairLock, setValidationQuery, setValidationQueryTimeout, setValidConnectionChecker, setValidConnectionCheckerClassName, validateConnection
getObjectName, getTimeBetweenLogStatsMillis, setConnectionProperties, setStatLoggerClassName, setTimeBetweenLogStatsMillis
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, getUrl, getUsername, getValidationQuery, getValidationQueryTimeout, getValidConnectionCheckerClassName, isBreakAfterAcquireFailure, isDefaultAutoCommit, isLogAbandoned, isPoolPreparedStatements, isRemoveAbandoned, isSharePreparedStatements, isTestOnBorrow, isTestOnReturn, isTestWhileIdle, isUseOracleImplicitCache, setLogAbandoned, setMaxPoolPreparedStatementPerConnectionSize, setTestOnBorrow, setTestWhileIdle, setTransactionThresholdMillis, setUseOracleImplicitCache
getObjectName, setObjectName
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
public static ThreadLocal<Long> waitNanosLocal
public DruidDataSource()
public DruidDataSource(boolean fairLock)
public void configFromPropety(Properties properties)
public boolean isUseGlobalDataSourceStat()
public void setUseGlobalDataSourceStat(boolean useGlobalDataSourceStat)
public String getInitStackTrace()
public boolean isResetStatEnable()
isResetStatEnable
在接口中 DruidDataSourceMBean
public void setResetStatEnable(boolean resetStatEnable)
setResetStatEnable
在接口中 DruidDataSourceMBean
public long getDiscardCount()
getDiscardCount
在接口中 DruidDataSourceMBean
public void restart() throws SQLException
SQLException
public void resetStat()
resetStat
在接口中 DruidDataSourceMBean
public long getResetCount()
getResetCount
在接口中 DruidDataSourceMBean
public boolean isEnable()
isEnable
在接口中 DruidDataSourceMBean
isEnable
在接口中 ManagedDataSource
public void setEnable(boolean enable)
setEnable
在接口中 ManagedDataSource
public void setPoolPreparedStatements(boolean value)
public void setMaxActive(int maxActive)
setMaxActive
在接口中 DruidAbstractDataSourceMBean
setMaxActive
在类中 DruidAbstractDataSource
public void setConnectProperties(Properties properties)
public void init() throws SQLException
SQLException
public DruidPooledConnection getConnection() throws SQLException
getConnection
在接口中 DataSource
SQLException
public DruidPooledConnection getConnection(long maxWaitMillis) throws SQLException
SQLException
public PooledConnection getPooledConnection() throws SQLException
getPooledConnection
在接口中 ConnectionPoolDataSource
SQLException
public PooledConnection getPooledConnection(String user, String password) throws SQLException
getPooledConnection
在接口中 ConnectionPoolDataSource
SQLException
public DruidPooledConnection getConnectionDirect(long maxWaitMillis) throws SQLException
SQLException
public void discardConnection(Connection realConnection)
discardConnection
在类中 DruidAbstractDataSource
realConnection
- SQLException
public void handleConnectionException(DruidPooledConnection pooledConnection, Throwable t) throws SQLException
handleConnectionException
在类中 DruidAbstractDataSource
SQLException
public long getRecycleErrorCount()
public void clearStatementCache() throws SQLException
clearStatementCache
在接口中 DruidDataSourceMBean
SQLException
public void close()
close
在接口中 Closeable
close
在接口中 AutoCloseable
public void registerMbean()
public void unregisterMbean()
public boolean isMbeanRegistered()
public Connection getConnection(String username, String password) throws SQLException
getConnection
在接口中 DataSource
SQLException
public long getCreateCount()
getCreateCount
在接口中 DruidAbstractDataSourceMBean
public long getDestroyCount()
getDestroyCount
在接口中 DruidAbstractDataSourceMBean
public long getConnectCount()
getConnectCount
在接口中 DruidAbstractDataSourceMBean
public long getCloseCount()
getCloseCount
在接口中 DruidAbstractDataSourceMBean
public long getConnectErrorCount()
public int getPoolingCount()
getPoolingCount
在接口中 DruidAbstractDataSourceMBean
public int getPoolingPeak()
getPoolingPeak
在接口中 DruidDataSourceMBean
public Date getPoolingPeakTime()
getPoolingPeakTime
在接口中 DruidDataSourceMBean
public long getRecycleCount()
getRecycleCount
在接口中 DruidAbstractDataSourceMBean
public int getActiveCount()
getActiveCount
在接口中 DruidAbstractDataSourceMBean
public void logStats()
public DruidDataSourceStatValue getStatValueAndReset()
public long getRemoveAbandonedCount()
public int removeAbandoned()
removeAbandoned
在接口中 DruidDataSourceMBean
public Reference getReference() throws NamingException
getReference
在接口中 Referenceable
NamingException
public int getRawDriverMajorVersion()
public int getRawDriverMinorVersion()
public String getProperties()
getProperties
在接口中 DruidAbstractDataSourceMBean
getProperties
在类中 DruidAbstractDataSource
public void shrink()
shrink
在接口中 DruidDataSourceMBean
public void shrink(boolean checkTime)
public int getWaitThreadCount()
getWaitThreadCount
在接口中 DruidDataSourceMBean
public long getNotEmptyWaitCount()
getNotEmptyWaitCount
在接口中 DruidDataSourceMBean
public int getNotEmptyWaitThreadCount()
public int getNotEmptyWaitThreadPeak()
public long getNotEmptySignalCount()
getNotEmptySignalCount
在接口中 DruidDataSourceMBean
public long getNotEmptyWaitMillis()
getNotEmptyWaitMillis
在接口中 DruidDataSourceMBean
public long getNotEmptyWaitNanos()
getNotEmptyWaitNanos
在接口中 DruidDataSourceMBean
public int getLockQueueLength()
getLockQueueLength
在接口中 DruidDataSourceMBean
public int getActivePeak()
getActivePeak
在接口中 DruidDataSourceMBean
getActivePeak
在类中 DruidAbstractDataSource
public Date getActivePeakTime()
getActivePeakTime
在接口中 DruidDataSourceMBean
public String dump()
dump
在接口中 DruidDataSourceMBean
public long getErrorCount()
getErrorCount
在接口中 DruidDataSourceMBean
public void logTransaction(TransactionInfo info)
logTransaction
在类中 DruidAbstractDataSource
public String getVersion()
getVersion
在接口中 DruidDataSourceMBean
public JdbcDataSourceStat getDataSourceStat()
getDataSourceStat
在接口中 DataSourceProxy
public Object clone() throws CloneNotSupportedException
clone
在类中 Object
CloneNotSupportedException
public DruidDataSource cloneDruidDataSource()
public JdbcSqlStat getSqlStat(int sqlId)
public JdbcSqlStat getSqlStat(long sqlId)
public Map<String,JdbcSqlStat> getSqlStatMap()
public WallProviderStatValue getWallStatValue(boolean reset)
public Lock getLock()
public boolean isWrapperFor(Class<?> iface)
isWrapperFor
在接口中 Wrapper
isWrapperFor
在类中 WrapperAdapter
public <T> T unwrap(Class<T> iface)
unwrap
在接口中 Wrapper
unwrap
在类中 WrapperAdapter
public boolean isLogDifferentThread()
public void setLogDifferentThread(boolean logDifferentThread)
public DruidPooledConnection tryGetConnection() throws SQLException
SQLException
public int fill() throws SQLException
fill
在接口中 DruidDataSourceMBean
SQLException
public int fill(int toCount) throws SQLException
fill
在接口中 DruidDataSourceMBean
SQLException
public boolean isFull()
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
在接口中 MBeanRegistration
Exception
public void postRegister(Boolean registrationDone)
postRegister
在接口中 MBeanRegistration
public void preDeregister() throws Exception
preDeregister
在接口中 MBeanRegistration
Exception
public void postDeregister()
postDeregister
在接口中 MBeanRegistration
Copyright © 2013-2015 Alibaba Group. All Rights Reserved.