DataSource object also implements this interface so that it can be easily configured through
an IoC container without having to specify a secondary object with a setter method.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | PKG_PREFIX
JMX prefix for interceptors that register themselves with JMX |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: percentage - a value between 0 and 100 to indicate when connections that have been abandoned/timed out are considered abandonedConnections that have been abandoned (timed out) wont get closed and reported up unless the number of connections in use are above the percentage defined by abandonWhenPercentageFull. |
| public boolean | |
| public String | Returns: the connection propertiesThe connection properties that will be sent to the JDBC driver when establishing new connections. |
| public Object | Returns: thejavax. to be used for creating connections to be pooled or null if a Driver is used.Returns a datasource, if one exists that is being used to create connections. |
| public String | Returns: the JNDI string or null if not setReturns the JNDI string configured for data source usage. |
| public Properties | Returns: database properties that are passed into thejava. method.Returns the database properties that are passed into the |
| public Boolean | Returns: the default auto commit setting, null is Driver default.The default auto-commit state of connections created by this pool. |
| public String | Returns: the default catalog, null if not set and accepting the driver default.If non null, during connection creation the method |
| public Boolean | Returns: null if not set and accepting the driver default otherwise the read only valueIf non null, during connection creation the method |
| public int | Returns: driver transaction isolation level, or -1DataSourceFactory#UNKNOWN_TRANSACTIONISOLATION if not set.Returns the default transaction isolation level. |
| public String | Returns: fully qualified JDBC driver name.The fully qualified Java class name of the JDBC driver to be used. |
| public int | Returns: number of connections to be started when pool is startedReturns the number of connections that will be established when the connection pool is started. |
| public String | Returns: the init SQL used to run against the DB or null if not setA custom query to be run when a connection is first created. |
| public String | Returns: the interceptors that are used for connections. Example format: 'ConnectionState(useEquals=true,fast=yes);ResetAbandonedTimer'A semicolon separated list of classnames extending |
| public PoolProperties. | Returns: an array of interceptors that have been configuredReturns the |
| public boolean | Returns: true if errors that happen during validation will be loggedReturns true if errors that happen during validation will be logged |
| public int | Returns: the maximum number of connections used by this poolThe maximum number of active connections that can be allocated from this pool at the same time. |
| public long | Returns: the time in milliseconds a connection will be open for when usedTime in milliseconds to keep this connection before reconnecting. |
| public int | Returns: the maximum number of idle connections.The maximum number of connections that should be kept in the idle pool if |
| public int | Returns: the number of milliseconds to wait for a connection to become available if the pool is maxed out.The maximum number of milliseconds that the pool will wait (when there are no available connections and the
|
| public int | Returns: the minimum amount of idle time in milliseconds before a connection is considered idle and eligible for eviction.The minimum amount of time an object must sit idle in the pool before it is eligible for eviction. |
| public int | Returns: the minimum number of idle or established connectionsThe minimum number of established connections that should be kept in the pool at all times. |
| public String | Returns: the name of the pool, should be unique in a JVMReturns the name of the connection pool. |
| public int | |
| public String | Returns: the password in string formatReturns the password used when establishing connections to the database. |
| public String | |
| public boolean | Returns: true if the pool is configured to propagate and not clear the thread interrupt stateReturns true if the pool is configured to propagate interrupt state of a thread. |
| public int | Returns: the time in seconds before a used connection can be considered abandonedThe time in seconds before a connection can be considered abandoned. |
| public boolean | |
| public int | Returns: Returns the time in seconds to pass before a connection is marked an abandoned suspect.Returns the time in seconds to pass before a connection is marked an abandoned suspect. |
| public int | Returns: the sleep time in between validations in millisecondsThe number of milliseconds to sleep between runs of the idle connection validation, abandoned cleaner and idle pool resizing. |
| public String | |
| public boolean | getUseDisposableConnectionFacade()
Returns |
| public boolean | Returns: true if a lock is used.Return true if a lock should be used when operations are performed on the connection object. |
| public String | Returns: the username used to establish the connection withReturns the username used to establish the connection with |
| public boolean | Returns: true if the statements are wrappedReturns |
| public long | Returns: the validation interval in millisecondsavoid excess validation, only run validation at most at this frequency - time in milliseconds. |
| public String | Returns: the query used for validation or null if no validation is performedThe SQL query that will be used to validate connections from this pool before returning them to the caller or pool. |
| public int | Returns: the timeout value in secondsThe timeout in seconds before a connection validation queries fail. |
| public Validator | |
| public String | Returns: the name of the optional validator class - may be nullReturn the name of the optional validator class - may be null. |
| public boolean | |
| public boolean | Returns: true ifgetConnection(username,password) is honored, false if it is ignored.Returns true if the call |
| public Boolean | Returns: the default auto commit setting, null is Driver default.The default auto-commit state of connections created by this pool. |
| public Boolean | Returns: null if not set and accepting the driver default otherwise the read only valueIf non null, during connection creation the method |
| public boolean | Returns: true if a fair waiting queue is being usedReturns |
| public boolean | |
| public boolean | Returns: true if the mbean object will be created upon startup.If set to true, the connection pool creates a |
| public boolean | Returns: true if the connection pool logs stack traces when connections are borrowed from the pool.boolean flag to set if stack traces should be logged for application code which abandoned a Connection. |
| public boolean | Returns: true if a background thread is or will be enabled for this poolReturns true if the pool sweeper is enabled for the connection pool. |
| public boolean | Returns: true if abandoned connections can be closed and expelled out of the poolboolean flag to remove abandoned connections if they exceed the removeAbandonedTimeout. |
| public boolean | Returns: true if the connection is to be validated upon borrowing a connection from the poolThe indication of whether objects will be validated before being borrowed from the pool. |
| public boolean | Returns: true if we should run the validation query upon connectReturns true if we should run the validation query when connecting to the database for the first time on a connection. |
| public boolean | Returns: true if validation should take place after a connection is returned to the poolThe indication of whether objects will be validated after being returned to the pool. |
| public boolean | Returns: true if validation should take place during idle checksSet to true if query validation should take place while the connection is idle. |
| public boolean | Returns: true if pool usesString#equals(Object) instead of == when comparing method names on java. methodsSet to true if you wish the |
| public void | setAbandonWhenPercentageFull(int
a value between 0 and 100 to indicate when connections that have been abandoned/timed out are considered abandoned percentage)Connections that have been abandoned (timed out) wont get closed and reported up unless the number of connections in use are above the percentage defined by abandonWhenPercentageFull. |
| public void | setAccessToUnderlyingConnectionAllowed(boolean
parameter ignored accessToUnderlyingConnectionAllowed)No-op |
| public void | setAlternateUsernameAllowed(boolean
- set true if alternateUsernameAllowed)getConnection(username,password) is honored,
false if it is to be ignored.Set to true if the call |
| public void | setCommitOnReturn(boolean
set to true if the pool should call commitOnReturn)java. when a connection is returned to the pool.
Default is falseSet to true if you want the connection pool to commit any pending transaction when a connection is returned. |
| public void | setConnectionProperties(String
properties - Format of the string is [propertyName=property;]*
Example: prop1=value1;prop2=value2 connectionProperties)The properties that will be passed into |
| public void | setDataSource(Object
the ds)javax. to be used for creating connections to be pooled.Injects a datasource that will be used to retrieve/create connections. |
| public void | setDataSourceJNDI(String
-the JNDI string @TODO specify the rules here. jndiDS)Configure the connection pool to use a DataSource according to |
| public void | setDbProperties(Properties
The database properties dbProperties)Overrides the database properties passed into the |
| public void | setDefaultAutoCommit(Boolean
default auto commit setting, null is Driver default. defaultAutoCommit)The default auto-commit state of connections created by this pool. |
| public void | setDefaultCatalog(String
null if not set and accepting the driver default. defaultCatalog)If non null, during connection creation the method |
| public void | setDefaultReadOnly(Boolean
null if not set and accepting the driver default. defaultReadOnly)If non null, during connection creation the method |
| public void | setDefaultTransactionIsolation(int
a value of defaultTransactionIsolation)java., java.,
java., java.,
java. or DataSourceFactory#UNKNOWN_TRANSACTIONISOLATION
The last value will not be set on the connection.If set to |
| public void | setDriverClassName(String
a fully qualified Java class name of a driverClassName)java. implementation.The fully qualified Java class name of the JDBC driver to be used. |
| public void | setFairQueue(boolean
true to use a fair queueSet to true if you wish that calls to getConnection should be treated fairly in a true FIFO fashion. |
| public void | setIgnoreExceptionOnPreLoad(boolean
set to true if you want to ignore error of connection creation while initializing the pool. ignoreExceptionOnPreLoad)Set to true if you want to ignore error of connection creation while initializing the pool. |
| public void | setInitialSize(int
the number of connections to be established. initialSize)Set the number of connections that will be established when the connection pool is started. |
| public void | setInitSQL(String
the init SQL used to run against the DB or null if no query should be executed initSQL)A custom query to be run when a connection is first created. |
| public void | setJdbcInterceptors(String
the interceptors that are used for connections.
Example format: 'ConnectionState(useEquals=true,fast=yes);ResetAbandonedTimer' jdbcInterceptors)A semicolon separated list of classnames extending |
| public void | setJmxEnabled(boolean
set to to if the mbean object should be created upon startup. jmxEnabled)If set to true, the connection pool creates a |
| public void | setLogAbandoned(boolean
set to true if stack traces should be recorded when logAbandoned)DataSource#getConnection() is called.boolean flag to set if stack traces should be logged for application code which abandoned a Connection. |
| public void | setLogValidationErrors(boolean
set to true to log validation errors logValidationErrors)Set to true if you wish that errors from validation should be logged as error messages. |
| public void | setMaxActive(int
hard limit for number of managed connections by this pool maxActive)The maximum number of active connections that can be allocated from this pool at the same time. |
| public void | setMaxAge(long
the time in milliseconds a connection will be open for when used maxAge)Time in milliseconds to keep this connection before reconnecting. |
| public void | setMaxIdle(int
the maximum size of the idle pool maxIdle)The maximum number of connections that should be kept in the idle pool if |
| public void | setMaxWait(int
the maximum number of milliseconds to wait. maxWait)The maximum number of milliseconds that the pool will wait (when there are no available connections and the
|
| public void | setMinEvictableIdleTimeMillis(int
the number of milliseconds a connection must be idle to be eligible for eviction. minEvictableIdleTimeMillis)The minimum amount of time an object must sit idle in the pool before it is eligible for eviction. |
| public void | setMinIdle(int
the minimum number of idle or established connections minIdle)The minimum number of established connections that should be kept in the pool at all times. |
| public void | |
| public void | |
| public void | |
| public void | setPropagateInterruptState(boolean
- set to true to not clear, but propagate, a threads interrupted state. propagateInterruptState)Configure the pool to propagate interrupt state for interrupted threads waiting for a connection
A thread waiting for a connection, can have its wait interrupted, and by default
will clear the interrupt flag and throw a |
| public void | setRemoveAbandoned(boolean
set to true if abandoned connections can be closed and expelled out of the pool removeAbandoned)boolean flag to remove abandoned connections if they exceed the removeAbandonedTimeout. |
| public void | setRemoveAbandonedTimeout(int
the time in seconds before a used connection can be considered abandoned removeAbandonedTimeout)The time in seconds before a connection can be considered abandoned. |
| public void | setRollbackOnReturn(boolean
set to true if the pool should call rollbackOnReturn)java. when a connection is returned to the pool.
Default is falseSet to true if you want the connection pool to rollback any pending transaction when a connection is returned. |
| public void | setSuspectTimeout(int
- the amount of time in seconds that has to pass before a connection is marked suspect. seconds)Similar to |
| public void | setTestOnBorrow(boolean
set to true if validation should take place before a connection is handed out to the application testOnBorrow)The indication of whether objects will be validated before being borrowed from the pool. |
| public void | setTestOnConnect(boolean
set to true if we should run the validation query upon connect testOnConnect)Set to true if we should run the validation query when connecting to the database for the first time on a connection. |
| public void | setTestOnReturn(boolean
true if validation should take place after a connection is returned to the pool testOnReturn)The indication of whether objects will be validated after being returned to the pool. |
| public void | setTestWhileIdle(boolean
true if validation should take place during idle checks testWhileIdle)Set to true if query validation should take place while the connection is idle. |
| public void | setTimeBetweenEvictionRunsMillis(int
the sleep time in between validations in milliseconds timeBetweenEvictionRunsMillis)The number of milliseconds to sleep between runs of the idle connection validation, abandoned cleaner and idle pool resizing. |
| public void | |
| public void | setUseDisposableConnectionFacade(boolean
true to use a facadeIf set to |
| public void | setUseEquals(boolean
set to true if the pool should use useEquals)String#equals(Object) instead of ==
when comparing method names on java. methodsSet to true if you wish the |
| public void | setUseLock(boolean
set to true if a lock should be used on connection operations useLock)Set to true if a lock should be used when operations are performed on the connection object. |
| public void | setUsername(String
The user name username)Sets the username used to establish the connection with It will also be a property called 'user' in the database properties. |
| public void | setUseStatementFacade(boolean
set to useStatementFacade)true to wrap statementsSet this to true if you wish to wrap statements in order to enable equals() and hashCode() methods to be called on the closed statements if any statement proxy is set. |
| public void | setValidationInterval(long
the validation interval in milliseconds validationInterval)avoid excess validation, only run validation at most at this frequency - time in milliseconds. |
| public void | setValidationQuery(String
the query used for validation or null if no validation is performed validationQuery)The SQL query that will be used to validate connections from this pool before returning them to the caller or pool. |
| public void | setValidationQueryTimeout(int
The timeout value validationQueryTimeout)The timeout in seconds before a connection validation queries fail. |
| public void | setValidator(Validator
The validator object validator)Sets the validator object If this is a non null object, it will be used as a validator instead of the validationQuery If this is null, remove the usage of the validator. |
| public void | setValidatorClassName(String
the name of the optional validator class className)Set the name for an optional validator class which will be used in place of test queries. |