@ConfigurationProperties(prefix="spring.datasource") public class DataSourceProperties extends Object implements BeanClassLoaderAware, InitializingBean
Modifier and Type | Class and Description |
---|---|
static class |
DataSourceProperties.Xa
XA Specific datasource settings.
|
Constructor and Description |
---|
DataSourceProperties() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
String |
determineDatabaseName()
Determine the name to used based on this configuration.
|
String |
determineDriverClassName()
Determine the driver to use based on this configuration and the environment.
|
String |
determinePassword()
Determine the password to use based on this configuration and the environment.
|
String |
determineUrl()
Determine the url to use based on this configuration and the environment.
|
String |
determineUsername()
Determine the username to use based on this configuration and the environment.
|
ClassLoader |
getClassLoader() |
String |
getDriverClassName()
Return the configured driver or
null if none was configured. |
EmbeddedDatabaseConnection |
getEmbeddedDatabaseConnection() |
String |
getJndiName() |
String |
getName() |
String |
getPassword()
Return the configured password or
null if none was configured. |
Class<? extends DataSource> |
getType() |
String |
getUrl()
Return the configured url or
null if none was configured. |
String |
getUsername()
Return the configured username or
null if none was configured. |
DataSourceProperties.Xa |
getXa() |
DataSourceBuilder<?> |
initializeDataSourceBuilder()
Initialize a
DataSourceBuilder with the state of this instance. |
boolean |
isGenerateUniqueName() |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setDriverClassName(String driverClassName) |
void |
setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection embeddedDatabaseConnection) |
void |
setGenerateUniqueName(boolean generateUniqueName) |
void |
setJndiName(String jndiName)
Allows the DataSource to be managed by the container and obtained through JNDI.
|
void |
setName(String name) |
void |
setPassword(String password) |
void |
setType(Class<? extends DataSource> type) |
void |
setUrl(String url) |
void |
setUsername(String username) |
void |
setXa(DataSourceProperties.Xa xa) |
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public DataSourceBuilder<?> initializeDataSourceBuilder()
DataSourceBuilder
with the state of this instance.DataSourceBuilder
initialized with the customizations defined on
this instancepublic boolean isGenerateUniqueName()
public void setGenerateUniqueName(boolean generateUniqueName)
public String getName()
public void setName(String name)
public Class<? extends DataSource> getType()
public void setType(Class<? extends DataSource> type)
public String getDriverClassName()
null
if none was configured.determineDriverClassName()
public void setDriverClassName(String driverClassName)
public String determineDriverClassName()
public String getUrl()
null
if none was configured.determineUrl()
public void setUrl(String url)
public String determineUrl()
public String determineDatabaseName()
null
public String getUsername()
null
if none was configured.determineUsername()
public void setUsername(String username)
public String determineUsername()
public String getPassword()
null
if none was configured.determinePassword()
public void setPassword(String password)
public String determinePassword()
public String getJndiName()
public void setJndiName(String jndiName)
URL
, driverClassName
, username
and password
fields
will be ignored when using JNDI lookups.jndiName
- the JNDI namepublic EmbeddedDatabaseConnection getEmbeddedDatabaseConnection()
public void setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection embeddedDatabaseConnection)
public ClassLoader getClassLoader()
public DataSourceProperties.Xa getXa()
public void setXa(DataSourceProperties.Xa xa)