类 DataSourceProperties
java.lang.Object
org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
- 所有已实现的接口:
Aware
,BeanClassLoaderAware
,InitializingBean
@ConfigurationProperties(prefix="spring.datasource")
public class DataSourceProperties
extends Object
implements BeanClassLoaderAware, InitializingBean
Base class for configuration of a data source.
- 从以下版本开始:
- 1.1.0
- 作者:
- Dave Syer, Maciej Walkowiak, Stephane Nicoll, Benedikt Ritter, Eddú Meléndez, Scott Frederick
-
嵌套类概要
嵌套类 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
Determine the name to used based on this configuration.Determine the driver to use based on this configuration and the environment.Determine the password to use based on this configuration and the environment.Determine the url to use based on this configuration and the environment.Determine the username to use based on this configuration and the environment.Return the configured driver ornull
if none was configured.getName()
Return the configured password ornull
if none was configured.Class
<? extends DataSource> getType()
getUrl()
Return the configured url ornull
if none was configured.Return the configured username ornull
if none was configured.getXa()
Initialize aDataSourceBuilder
with the state of this instance.boolean
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
void
setPassword
(String password) void
setType
(Class<? extends DataSource> type) void
void
setUsername
(String username) void
-
构造器详细资料
-
DataSourceProperties
public DataSourceProperties()
-
-
方法详细资料
-
setBeanClassLoader
- 指定者:
setBeanClassLoader
在接口中BeanClassLoaderAware
-
afterPropertiesSet
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
-
initializeDataSourceBuilder
Initialize aDataSourceBuilder
with the state of this instance.- 返回:
- a
DataSourceBuilder
initialized with the customizations defined on this instance
-
isGenerateUniqueName
public boolean isGenerateUniqueName() -
setGenerateUniqueName
public void setGenerateUniqueName(boolean generateUniqueName) -
getName
-
setName
-
getType
-
setType
-
getDriverClassName
Return the configured driver ornull
if none was configured.- 返回:
- the configured driver
- 另请参阅:
-
setDriverClassName
-
determineDriverClassName
Determine the driver to use based on this configuration and the environment.- 返回:
- the driver to use
- 从以下版本开始:
- 1.4.0
-
getUrl
Return the configured url ornull
if none was configured.- 返回:
- the configured url
- 另请参阅:
-
setUrl
-
determineUrl
Determine the url to use based on this configuration and the environment.- 返回:
- the url to use
- 从以下版本开始:
- 1.4.0
-
determineDatabaseName
Determine the name to used based on this configuration.- 返回:
- the database name to use or
null
- 从以下版本开始:
- 2.0.0
-
getUsername
Return the configured username ornull
if none was configured.- 返回:
- the configured username
- 另请参阅:
-
setUsername
-
determineUsername
Determine the username to use based on this configuration and the environment.- 返回:
- the username to use
- 从以下版本开始:
- 1.4.0
-
getPassword
Return the configured password ornull
if none was configured.- 返回:
- the configured password
- 另请参阅:
-
setPassword
-
determinePassword
Determine the password to use based on this configuration and the environment.- 返回:
- the password to use
- 从以下版本开始:
- 1.4.0
-
getJndiName
-
setJndiName
Allows the DataSource to be managed by the container and obtained through JNDI. TheURL
,driverClassName
,username
andpassword
fields will be ignored when using JNDI lookups.- 参数:
jndiName
- the JNDI name
-
getEmbeddedDatabaseConnection
-
setEmbeddedDatabaseConnection
-
getClassLoader
-
getXa
-
setXa
-