@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(String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getConfiguredDriverClassName() |
String |
getConfiguredPassword() |
String |
getConfiguredUrl() |
String |
getConfiguredUsername() |
String |
getConfiguredValidationQuery() |
String |
getDriverClassName() |
String |
getJndiName() |
String |
getPassword() |
String |
getUrl() |
String |
getUsername() |
String |
getValidationQuery() |
void |
setDataSourceProperties(Map<String,?> dsProperties)
Sets the datasource properties.
|
void |
setDbProperties(Properties dbProperties) |
void |
setJndiName(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 String name)
name
- name that comes from propertiespublic void setDbProperties(@MapFormat(keyFormat=UNDER_SCORE_SEPARATED) Properties dbProperties)
setDbProperties
in interface org.apache.tomcat.jdbc.pool.PoolConfiguration
setDbProperties
in class org.apache.tomcat.jdbc.pool.PoolProperties
public 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 String getConfiguredDriverClassName()
getConfiguredDriverClassName
in interface BasicJdbcConfiguration
public 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 String getConfiguredUrl()
getConfiguredUrl
in interface BasicJdbcConfiguration
public 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 String getConfiguredUsername()
getConfiguredUsername
in interface BasicJdbcConfiguration
public 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 String getConfiguredPassword()
getConfiguredPassword
in interface BasicJdbcConfiguration
public 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) Map<String,?> dsProperties)
BasicJdbcConfiguration
setDataSourceProperties
in interface BasicJdbcConfiguration
dsProperties
- The propertiespublic String getConfiguredValidationQuery()
getConfiguredValidationQuery
in interface BasicJdbcConfiguration
public String getJndiName()
public void setJndiName(String jndiName)
jndiName
- Set the JDNI name