类 MyDruidDataSource
java.lang.Object
com.alibaba.druid.pool.WrapperAdapter
com.alibaba.druid.pool.DruidAbstractDataSource
com.alibaba.druid.pool.DruidDataSource
com.walker.jdbc.ds.MyDruidDataSource
- 所有已实现的接口:
com.alibaba.druid.pool.DruidAbstractDataSourceMBean,com.alibaba.druid.pool.DruidDataSourceMBean,com.alibaba.druid.pool.ManagedDataSource,com.alibaba.druid.proxy.jdbc.DataSourceProxy,DataSourceMeta,Closeable,Serializable,AutoCloseable,Cloneable,Wrapper,MBeanRegistration,Referenceable,CommonDataSource,ConnectionPoolDataSource,DataSource
public class MyDruidDataSource
extends com.alibaba.druid.pool.DruidDataSource
implements DataSourceMeta
包装阿里
DruidDataSource 数据源,形成自己的类型,隔离依赖。- 作者:
- 时克英
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 com.alibaba.druid.pool.DruidDataSource
com.alibaba.druid.pool.DruidDataSource.CreateConnectionTask, com.alibaba.druid.pool.DruidDataSource.CreateConnectionThread, com.alibaba.druid.pool.DruidDataSource.DestroyConnectionThread, com.alibaba.druid.pool.DruidDataSource.DestroyTask, com.alibaba.druid.pool.DruidDataSource.LogStatsThread从类继承的嵌套类/接口 com.alibaba.druid.pool.DruidAbstractDataSource
com.alibaba.druid.pool.DruidAbstractDataSource.PhysicalConnectionInfo -
字段概要
字段从类继承的字段 com.alibaba.druid.pool.DruidDataSource
checkExecuteTime, connectErrorCountUpdater, createTaskIdSeedUpdater, dataSourceStat, discardErrorCountUpdater, instanceKey, keepAliveCheckErrorCountUpdater, killWhenSocketReadTimeout, recycleErrorCountUpdater, resetCountUpdater, waitNanosLocal从类继承的字段 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, 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, validationQuery, validationQueryTimeout, validConnectionChecker -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明获得连接数据库名字获得数据库类型getIp()获得数据库密码intgetPort()getUrl()获得连接数据库URL原始内容获得数据源库用户名voidsetDatabaseName(String databaseName) voidsetDatabaseType(int databaseTypeValue) voidsetDriverClassName(String driverClassName) 重写druid设置url方法,初始化数据源。voidvoidsetPassword(String password) voidsetPort(int port) void重写druid设置url方法,初始化数据源。voidsetUsername(String username) 从类继承的方法 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, unwrap从类继承的方法 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, getPasswordCallback, getPhyMaxUseCount, getPhyTimeoutMillis, getPreparedStatementCount, getProxyFilters, getQueryTimeout, getRawDriver, getRawJdbcUrl, getRemoveAbandonedTimeout, getRemoveAbandonedTimeoutMillis, getRollbackCount, getSocketTimeout, getStartTransactionCount, getStatLogger, getTimeBetweenConnectErrorMillis, getTimeBetweenEvictionRunsMillis, getTimeBetweenLogStatsMillis, getTransactionHistogram, getTransactionHistogramRanges, getTransactionHistogramValues, getTransactionQueryTimeout, getTransactionThresholdMillis, getUserCallback, 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, setDupCloseLogEnable, setExceptionSorter, setExceptionSorter, setExceptionSorterClassName, setFailContinuous, setFailFast, setFilters, setInitExceptionThrow, setInitGlobalVariants, setInitialSize, setInitVariants, setKeepAliveBetweenTimeMillis, setLogAbandoned, setLoginTimeout, setLogWriter, setMaxCreateTaskCount, setMaxEvictableIdleTimeMillis, setMaxIdle, setMaxOpenPreparedStatements, setMaxPoolPreparedStatementPerConnectionSize, setMaxWait, setMaxWaitThreadCount, setMinEvictableIdleTimeMillis, setMinIdle, setName, setNotFullTimeoutRetryCount, setNumTestsPerEvictionRun, setObjectName, setOnFatalErrorMaxActive, setOracle, setPasswordCallback, setPasswordCallbackClassName, setPhyMaxUseCount, setPhyTimeoutMillis, setProxyFilters, setQueryTimeout, setRemoveAbandoned, setRemoveAbandonedTimeout, setRemoveAbandonedTimeoutMillis, setSharePreparedStatements, setSocketTimeout, setSocketTimeout, setStatLogger, setStatLoggerClassName, setTestOnBorrow, setTestOnReturn, setTestWhileIdle, setTimeBetweenConnectErrorMillis, setTimeBetweenEvictionRunsMillis, setTimeBetweenLogStatsMillis, setTransactionQueryTimeout, setTransactionThresholdMillis, setUseLocalSessionState, setUseOracleImplicitCache, setUsePingMethod, setUserCallback, setUseUnfairLock, setValidationQuery, setValidationQueryTimeout, setValidConnectionChecker, setValidConnectionCheckerClassName, testConnectionInternal, testConnectionInternal, validateConnection从接口继承的方法 javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLogger从接口继承的方法 javax.sql.ConnectionPoolDataSource
createPooledConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter从接口继承的方法 javax.sql.DataSource
createConnectionBuilder, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter从接口继承的方法 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, getValidationQuery, getValidationQueryTimeout, getValidConnectionCheckerClassName, isBreakAfterAcquireFailure, isDefaultAutoCommit, isLogAbandoned, isPoolPreparedStatements, isRemoveAbandoned, isSharePreparedStatements, isTestOnBorrow, isTestOnReturn, isTestWhileIdle, isUseOracleImplicitCache, setLogAbandoned, setMaxPoolPreparedStatementPerConnectionSize, setTestOnBorrow, setTestWhileIdle, setTransactionThresholdMillis, setUseOracleImplicitCache从接口继承的方法 com.alibaba.druid.pool.DruidDataSourceMBean
getObjectName, getTimeBetweenLogStatsMillis, setConnectionProperties, setStatLoggerClassName, setTimeBetweenLogStatsMillis从接口继承的方法 com.alibaba.druid.pool.ManagedDataSource
getObjectName, setObjectName
-
字段详细资料
-
logger
protected final transient org.slf4j.Logger logger -
ip
-
port
protected int port
-
-
构造器详细资料
-
MyDruidDataSource
public MyDruidDataSource()
-
-
方法详细资料
-
getDatabaseType
从接口复制的说明:DataSourceMeta获得数据库类型- 指定者:
getDatabaseType在接口中DataSourceMeta- 返回:
-
getDatabaseName
从接口复制的说明:DataSourceMeta获得连接数据库名字- 指定者:
getDatabaseName在接口中DataSourceMeta- 返回:
-
getIp
- 指定者:
getIp在接口中DataSourceMeta
-
getPort
public int getPort()- 指定者:
getPort在接口中DataSourceMeta
-
getUsername
从接口复制的说明:DataSourceMeta获得数据源库用户名- 指定者:
getUsername在接口中DataSourceMeta- 指定者:
getUsername在接口中com.alibaba.druid.pool.DruidAbstractDataSourceMBean- 覆盖:
getUsername在类中com.alibaba.druid.pool.DruidAbstractDataSource
-
getPassword
从接口复制的说明:DataSourceMeta获得数据库密码- 指定者:
getPassword在接口中DataSourceMeta- 覆盖:
getPassword在类中com.alibaba.druid.pool.DruidAbstractDataSource- 返回:
-
getUrl
从接口复制的说明:DataSourceMeta获得连接数据库URL原始内容- 指定者:
getUrl在接口中DataSourceMeta- 指定者:
getUrl在接口中com.alibaba.druid.proxy.jdbc.DataSourceProxy- 指定者:
getUrl在接口中com.alibaba.druid.pool.DruidAbstractDataSourceMBean- 指定者:
getUrl在接口中com.alibaba.druid.pool.DruidDataSourceMBean- 覆盖:
getUrl在类中com.alibaba.druid.pool.DruidAbstractDataSource
-
setPassword
- 指定者:
setPassword在接口中DataSourceMeta- 覆盖:
setPassword在类中com.alibaba.druid.pool.DruidAbstractDataSource
-
setUsername
- 指定者:
setUsername在接口中DataSourceMeta- 覆盖:
setUsername在类中com.alibaba.druid.pool.DruidAbstractDataSource
-
setUrl
重写druid设置url方法,初始化数据源。- 覆盖:
setUrl在类中com.alibaba.druid.pool.DruidAbstractDataSource- 参数:
jdbcUrl-
-
setDriverClassName
重写druid设置url方法,初始化数据源。- 覆盖:
setDriverClassName在类中com.alibaba.druid.pool.DruidAbstractDataSource- 参数:
driverClassName-
-
setIp
-
setPort
public void setPort(int port) -
setDatabaseType
public void setDatabaseType(int databaseTypeValue) -
setDatabaseName
-