- All Superinterfaces:
CommonDataSource,DataSource,Wrapper
DataSource pool API.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the reason, why the dataSource is down.default SQLExceptionDeprecated.default StringgetName()Deprecated.default PoolStatusgetStatus(boolean reset) Deprecated.intDeprecated.booleanReturn true if the pool defaults to using autocommit.booleanReturns false when the dataSource is down.booleanisOnline()Return true if the DataSource is online.name()Return the dataSource name.voidoffline()Take the DataSource offline closing all connections and stopping heart beat checking.voidonline()Bring the DataSource online ensuring min connections and start heart beat checking.voidsetMaxSize(int max) Set a new maximum size.voidsetWarningSize(int warningSize) Deprecated.voidshutdown()Shutdown the pool.intsize()Return the current size of the pool.status(boolean reset) Return the current status of the connection pool.Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLoggerMethods inherited from interface javax.sql.DataSource
createConnectionBuilder, getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriterMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
name
String name()Return the dataSource name. -
getName
Deprecated.Deprecated migrate to name(). -
size
int size()Return the current size of the pool. This includes both busy and idle connections. -
isAutoCommit
boolean isAutoCommit()Return true if the pool defaults to using autocommit. -
isOnline
boolean isOnline()Return true if the DataSource is online.Effectively the same as (synonym for)
isDataSourceUp(). -
isDataSourceUp
boolean isDataSourceUp()Returns false when the dataSource is down.Effectively the same as (synonym for)
isOnline(). -
online
Bring the DataSource online ensuring min connections and start heart beat checking.- Throws:
SQLException
-
offline
void offline()Take the DataSource offline closing all connections and stopping heart beat checking. -
shutdown
void shutdown()Shutdown the pool.This is functionally the same as
offline()but generally we expect to only shut down the pool once whereas we can expect to make many calls to offline() and online(). -
status
Return the current status of the connection pool.With reset true, the counters are reset.
-
getStatus
Deprecated.Deprecated migrate to status(). -
dataSourceDownReason
SQLException dataSourceDownReason()Returns the reason, why the dataSource is down. -
getDataSourceDownReason
Deprecated.Deprecated migrate to dataSourceDownReason(). -
setMaxSize
void setMaxSize(int max) Set a new maximum size.The pool will apply the new maximum and not require a restart.
-
setWarningSize
Deprecated.Deprecated - looking to remove.Set a new maximum size. The pool should respect this new warning level immediately and not require a restart. We may want to increase the maxConnections if the pool gets large and hits the warning levels.
-
getWarningSize
Deprecated.Deprecated - looking to remove.Return the warning size. When the pool hits this size it can send a warning message to an administrator.
-