@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() |
List<String> |
getData()
Deprecated.
|
String |
getDataPassword()
Deprecated.
|
String |
getDataUsername()
Deprecated.
|
String |
getDriverClassName()
Return the configured driver or
null if none was configured. |
EmbeddedDatabaseConnection |
getEmbeddedDatabaseConnection() |
DataSourceInitializationMode |
getInitializationMode()
Deprecated.
|
String |
getJndiName() |
String |
getName() |
String |
getPassword()
Return the configured password or
null if none was configured. |
String |
getPlatform()
Deprecated.
|
List<String> |
getSchema()
Deprecated.
|
String |
getSchemaPassword()
Deprecated.
|
String |
getSchemaUsername()
Deprecated.
|
String |
getSeparator()
Deprecated.
|
Charset |
getSqlScriptEncoding()
Deprecated.
|
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 |
isContinueOnError()
Deprecated.
|
boolean |
isGenerateUniqueName() |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setContinueOnError(boolean continueOnError)
Deprecated.
|
void |
setData(List<String> data)
Deprecated.
|
void |
setDataPassword(String dataPassword)
Deprecated.
|
void |
setDataUsername(String dataUsername)
Deprecated.
|
void |
setDriverClassName(String driverClassName) |
void |
setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection embeddedDatabaseConnection) |
void |
setGenerateUniqueName(boolean generateUniqueName) |
void |
setInitializationMode(DataSourceInitializationMode initializationMode)
Deprecated.
|
void |
setJndiName(String jndiName)
Allows the DataSource to be managed by the container and obtained via JNDI.
|
void |
setName(String name) |
void |
setPassword(String password) |
void |
setPlatform(String platform)
Deprecated.
|
void |
setSchema(List<String> schema)
Deprecated.
|
void |
setSchemaPassword(String schemaPassword)
Deprecated.
|
void |
setSchemaUsername(String schemaUsername)
Deprecated.
|
void |
setSeparator(String separator)
Deprecated.
|
void |
setSqlScriptEncoding(Charset sqlScriptEncoding)
Deprecated.
|
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 name@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.mode") public DataSourceInitializationMode getInitializationMode()
@Deprecated public void setInitializationMode(DataSourceInitializationMode initializationMode)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.platform") public String getPlatform()
@Deprecated public void setPlatform(String platform)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.schema-locations") public List<String> getSchema()
@Deprecated public void setSchema(List<String> schema)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.username") public String getSchemaUsername()
@Deprecated public void setSchemaUsername(String schemaUsername)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.password") public String getSchemaPassword()
@Deprecated public void setSchemaPassword(String schemaPassword)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.data-locations") public List<String> getData()
@Deprecated public void setData(List<String> data)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.username") public String getDataUsername()
@Deprecated public void setDataUsername(String dataUsername)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.password") public String getDataPassword()
@Deprecated public void setDataPassword(String dataPassword)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.continue-on-error") public boolean isContinueOnError()
@Deprecated public void setContinueOnError(boolean continueOnError)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.separator") public String getSeparator()
@Deprecated public void setSeparator(String separator)
@Deprecated @DeprecatedConfigurationProperty(replacement="spring.sql.init.encoding") public Charset getSqlScriptEncoding()
@Deprecated public void setSqlScriptEncoding(Charset sqlScriptEncoding)
public EmbeddedDatabaseConnection getEmbeddedDatabaseConnection()
public void setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection embeddedDatabaseConnection)
public ClassLoader getClassLoader()
public DataSourceProperties.Xa getXa()
public void setXa(DataSourceProperties.Xa xa)