@Context
@EachProperty(value="datasources",
primary="default")
public class DatasourceConfiguration
extends org.apache.commons.dbcp2.BasicDataSource
implements io.micronaut.jdbc.BasicJdbcConfiguration
BasicDataSource
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 datastore will be configured based on the available
drivers on the classpath.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 |
getName()
Get the name of the bean.
|
String |
getPassword() |
String |
getUrl() |
String |
getUsername() |
String |
getValidationQuery() |
addConnectionProperty, close, createConnectionFactory, createConnectionPool, createDataSource, createDataSourceInstance, createObjectPool, createPoolableConnectionFactory, evict, getAbandonedLogWriter, getAbandonedUsageTracking, getAutoCommitOnReturn, getCacheState, getConnection, getConnection, getConnectionInitSqls, getConnectionInitSqlsAsArray, getConnectionPool, getDefaultAutoCommit, getDefaultCatalog, getDefaultQueryTimeout, getDefaultReadOnly, getDefaultSchema, getDefaultTransactionIsolation, getDisconnectionSqlCodes, getDisconnectionSqlCodesAsArray, getDriver, getDriverClassLoader, getEnableAutoCommitOnReturn, getEvictionPolicyClassName, getFastFailValidation, getInitialSize, getJmxName, getLifo, getLogAbandoned, getLogExpiredConnections, getLoginTimeout, getLogWriter, getMaxConnLifetimeMillis, getMaxIdle, getMaxOpenPreparedStatements, getMaxTotal, getMaxWaitMillis, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumTestsPerEvictionRun, getParentLogger, getRegisteredJmxName, getRemoveAbandonedOnBorrow, getRemoveAbandonedOnMaintenance, getRemoveAbandonedTimeout, getRollbackOnReturn, getSoftMinEvictableIdleTimeMillis, getTestOnBorrow, getTestOnCreate, getTestOnReturn, getTestWhileIdle, getTimeBetweenEvictionRunsMillis, getValidationQueryTimeout, invalidateConnection, isAccessToUnderlyingConnectionAllowed, isClosed, isPoolPreparedStatements, isWrapperFor, log, postDeregister, postRegister, preDeregister, preRegister, removeConnectionProperty, setAbandonedLogWriter, setAbandonedUsageTracking, setAccessToUnderlyingConnectionAllowed, setAutoCommitOnReturn, setCacheState, setConnectionInitSqls, setConnectionProperties, setDefaultAutoCommit, setDefaultCatalog, setDefaultQueryTimeout, setDefaultReadOnly, setDefaultSchema, setDefaultTransactionIsolation, setDisconnectionSqlCodes, setDriver, setDriverClassLoader, setDriverClassName, setEnableAutoCommitOnReturn, setEvictionPolicyClassName, setFastFailValidation, setInitialSize, setJmxName, setLifo, setLogAbandoned, setLogExpiredConnections, setLoginTimeout, setLogWriter, setMaxConnLifetimeMillis, setMaxIdle, setMaxOpenPreparedStatements, setMaxTotal, setMaxWaitMillis, setMinEvictableIdleTimeMillis, setMinIdle, setNumTestsPerEvictionRun, setPassword, setPoolPreparedStatements, setRemoveAbandonedOnBorrow, setRemoveAbandonedOnMaintenance, setRemoveAbandonedTimeout, setRollbackOnReturn, setSoftMinEvictableIdleTimeMillis, setTestOnBorrow, setTestOnCreate, setTestOnReturn, setTestWhileIdle, setTimeBetweenEvictionRunsMillis, setUrl, setUsername, setValidationQuery, setValidationQueryTimeout, startPoolMaintenance, unwrap, validateConnectionFactory
public DatasourceConfiguration(@Parameter String name)
name
- name configured from propertiespublic String getName()
getName
in interface io.micronaut.jdbc.BasicJdbcConfiguration
public String getDriverClassName()
getDriverClassName
in interface io.micronaut.jdbc.BasicJdbcConfiguration
getDriverClassName
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getDriverClassName
in class org.apache.commons.dbcp2.BasicDataSource
public String getConfiguredDriverClassName()
getConfiguredDriverClassName
in interface io.micronaut.jdbc.BasicJdbcConfiguration
public String getUrl()
getUrl
in interface io.micronaut.jdbc.BasicJdbcConfiguration
getUrl
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getUrl
in class org.apache.commons.dbcp2.BasicDataSource
public String getConfiguredUrl()
getConfiguredUrl
in interface io.micronaut.jdbc.BasicJdbcConfiguration
public String getUsername()
getUsername
in interface io.micronaut.jdbc.BasicJdbcConfiguration
getUsername
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getUsername
in class org.apache.commons.dbcp2.BasicDataSource
public String getConfiguredUsername()
getConfiguredUsername
in interface io.micronaut.jdbc.BasicJdbcConfiguration
public String getPassword()
getPassword
in interface io.micronaut.jdbc.BasicJdbcConfiguration
getPassword
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getPassword
in class org.apache.commons.dbcp2.BasicDataSource
public String getConfiguredPassword()
getConfiguredPassword
in interface io.micronaut.jdbc.BasicJdbcConfiguration
public String getValidationQuery()
getValidationQuery
in interface io.micronaut.jdbc.BasicJdbcConfiguration
getValidationQuery
in interface org.apache.commons.dbcp2.BasicDataSourceMXBean
getValidationQuery
in class org.apache.commons.dbcp2.BasicDataSource
public String getConfiguredValidationQuery()
getConfiguredValidationQuery
in interface io.micronaut.jdbc.BasicJdbcConfiguration