@EachProperty(value="datasources", primary="default") public class DatasourceConfiguration extends org.apache.tomcat.jdbc.pool.PoolProperties implements BasicJdbcConfiguration
PoolProperties
are available to be configured.
If the url, driver class, username, or password are missing, sensible defaults
will be provided when possible. If no configuration beyond the datasource name
is provided, an in memory datasource will be configured based on the available
drivers on the classpath.DEFAULT_MAX_ACTIVE, poolCounter
PREFIX
Constructor and Description |
---|
DatasourceConfiguration(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConfiguredDriverClassName() |
java.lang.String |
getConfiguredPassword() |
java.lang.String |
getConfiguredUrl() |
java.lang.String |
getConfiguredUsername() |
java.lang.String |
getConfiguredValidationQuery() |
java.lang.String |
getDriverClassName() |
java.lang.String |
getJndiName() |
java.lang.String |
getPassword() |
java.lang.String |
getUrl() |
java.lang.String |
getUsername() |
java.lang.String |
getValidationQuery() |
void |
setDataSourceProperties(java.util.Map<java.lang.String,?> dsProperties)
Sets the datasource properties.
|
void |
setDbProperties(java.util.Properties dbProperties) |
void |
setJndiName(java.lang.String jndiName) |
clone, getAbandonWhenPercentageFull, getCommitOnReturn, getConnectionProperties, getDataSource, getDataSourceJNDI, getDbProperties, getDefaultAutoCommit, getDefaultCatalog, getDefaultReadOnly, getDefaultTransactionIsolation, getInitialSize, getInitSQL, getJdbcInterceptors, getJdbcInterceptorsAsArray, getLogValidationErrors, getMaxActive, getMaxAge, getMaxIdle, getMaxWait, getMinEvictableIdleTimeMillis, getMinIdle, getName, getNumTestsPerEvictionRun, getPoolCounter, getPoolName, getPropagateInterruptState, getProperties, getRemoveAbandonedTimeout, getRollbackOnReturn, getSuspectTimeout, getTimeBetweenEvictionRunsMillis, getUseDisposableConnectionFacade, getUseLock, getUseStatementFacade, getValidationInterval, getValidationQueryTimeout, getValidator, getValidatorClassName, isAccessToUnderlyingConnectionAllowed, isAlternateUsernameAllowed, isDefaultAutoCommit, isDefaultReadOnly, isFairQueue, isIgnoreExceptionOnPreLoad, isJmxEnabled, isLogAbandoned, isPoolSweeperEnabled, isRemoveAbandoned, isTestOnBorrow, isTestOnConnect, isTestOnReturn, isTestWhileIdle, isUseEquals, setAbandonWhenPercentageFull, setAccessToUnderlyingConnectionAllowed, setAlternateUsernameAllowed, setCommitOnReturn, setConnectionProperties, setDataSource, setDataSourceJNDI, setDefaultAutoCommit, setDefaultCatalog, setDefaultReadOnly, setDefaultTransactionIsolation, setDriverClassName, setFairQueue, setIgnoreExceptionOnPreLoad, setInitialSize, setInitSQL, setJdbcInterceptors, setJmxEnabled, setLogAbandoned, setLogValidationErrors, setMaxActive, setMaxAge, setMaxIdle, setMaxWait, setMinEvictableIdleTimeMillis, setMinIdle, setName, setNumTestsPerEvictionRun, setPassword, setPropagateInterruptState, setRemoveAbandoned, setRemoveAbandonedTimeout, setRollbackOnReturn, setSuspectTimeout, setTestOnBorrow, setTestOnConnect, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUseDisposableConnectionFacade, setUseEquals, setUseLock, setUsername, setUseStatementFacade, setValidationInterval, setValidationQuery, setValidationQueryTimeout, setValidator, setValidatorClassName, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, setDriverClassName, setPassword, setUrl, setUsername
public DatasourceConfiguration(@Parameter java.lang.String name)
name
- name that comes from propertiespublic void setDbProperties(@MapFormat(keyFormat=UNDER_SCORE_SEPARATED) java.util.Properties dbProperties)
setDbProperties
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
setDbProperties
in class org.apache.tomcat.jdbc.pool.PoolProperties
public java.lang.String getDriverClassName()
getDriverClassName
in interface BasicJdbcConfiguration
getDriverClassName
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
getDriverClassName
in class org.apache.tomcat.jdbc.pool.PoolProperties
public java.lang.String getConfiguredDriverClassName()
getConfiguredDriverClassName
in interface BasicJdbcConfiguration
public java.lang.String getUrl()
getUrl
in interface BasicJdbcConfiguration
getUrl
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
getUrl
in class org.apache.tomcat.jdbc.pool.PoolProperties
public java.lang.String getConfiguredUrl()
getConfiguredUrl
in interface BasicJdbcConfiguration
public java.lang.String getUsername()
getUsername
in interface BasicJdbcConfiguration
getUsername
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
getUsername
in class org.apache.tomcat.jdbc.pool.PoolProperties
public java.lang.String getConfiguredUsername()
getConfiguredUsername
in interface BasicJdbcConfiguration
public java.lang.String getPassword()
getPassword
in interface BasicJdbcConfiguration
getPassword
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
getPassword
in class org.apache.tomcat.jdbc.pool.PoolProperties
public java.lang.String getConfiguredPassword()
getConfiguredPassword
in interface BasicJdbcConfiguration
public java.lang.String getValidationQuery()
getValidationQuery
in interface BasicJdbcConfiguration
getValidationQuery
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
getValidationQuery
in class org.apache.tomcat.jdbc.pool.PoolProperties
public void setDataSourceProperties(@MapFormat(transformation=FLAT,keyFormat=RAW) java.util.Map<java.lang.String,?> dsProperties)
BasicJdbcConfiguration
setDataSourceProperties
in interface BasicJdbcConfiguration
dsProperties
- The propertiespublic java.lang.String getConfiguredValidationQuery()
getConfiguredValidationQuery
in interface BasicJdbcConfiguration
public java.lang.String getJndiName()
public void setJndiName(java.lang.String jndiName)
jndiName
- Set the JDNI name