@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() |
String |
getDataPassword() |
String |
getDataUsername() |
String |
getDriverClassName()
Return the configured driver or
null if none was configured. |
DataSourceInitializationMode |
getInitializationMode() |
String |
getJndiName() |
String |
getName() |
String |
getPassword()
Return the configured password or
null if none was configured. |
String |
getPlatform() |
List<String> |
getSchema() |
String |
getSchemaPassword() |
String |
getSchemaUsername() |
String |
getSeparator() |
Charset |
getSqlScriptEncoding() |
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() |
boolean |
isGenerateUniqueName() |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setContinueOnError(boolean continueOnError) |
void |
setData(List<String> data) |
void |
setDataPassword(String dataPassword) |
void |
setDataUsername(String dataUsername) |
void |
setDriverClassName(String driverClassName) |
void |
setGenerateUniqueName(boolean generateUniqueName) |
void |
setInitializationMode(DataSourceInitializationMode initializationMode) |
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) |
void |
setSchema(List<String> schema) |
void |
setSchemaPassword(String schemaPassword) |
void |
setSchemaUsername(String schemaUsername) |
void |
setSeparator(String separator) |
void |
setSqlScriptEncoding(Charset sqlScriptEncoding) |
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 String getName()
public void setName(String name)
public boolean isGenerateUniqueName()
public void setGenerateUniqueName(boolean generateUniqueName)
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 DataSourceInitializationMode getInitializationMode()
public void setInitializationMode(DataSourceInitializationMode initializationMode)
public String getPlatform()
public void setPlatform(String platform)
public String getSchemaUsername()
public void setSchemaUsername(String schemaUsername)
public String getSchemaPassword()
public void setSchemaPassword(String schemaPassword)
public String getDataUsername()
public void setDataUsername(String dataUsername)
public String getDataPassword()
public void setDataPassword(String dataPassword)
public boolean isContinueOnError()
public void setContinueOnError(boolean continueOnError)
public String getSeparator()
public void setSeparator(String separator)
public Charset getSqlScriptEncoding()
public void setSqlScriptEncoding(Charset sqlScriptEncoding)
public ClassLoader getClassLoader()
public DataSourceProperties.Xa getXa()
public void setXa(DataSourceProperties.Xa xa)
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.