类 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
  • 构造器详细资料

    • DataSourceProperties

      public DataSourceProperties()
  • 方法详细资料

    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader classLoader)
      指定者:
      setBeanClassLoader 在接口中 BeanClassLoaderAware
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      指定者:
      afterPropertiesSet 在接口中 InitializingBean
      抛出:
      Exception
    • initializeDataSourceBuilder

      public DataSourceBuilder<?> initializeDataSourceBuilder()
      Initialize a DataSourceBuilder 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

      public String getName()
    • setName

      public void setName(String name)
    • getType

      public Class<? extends DataSource> getType()
    • setType

      public void setType(Class<? extends DataSource> type)
    • getDriverClassName

      public String getDriverClassName()
      Return the configured driver or null if none was configured.
      返回:
      the configured driver
      另请参阅:
    • setDriverClassName

      public void setDriverClassName(String driverClassName)
    • determineDriverClassName

      public String determineDriverClassName()
      Determine the driver to use based on this configuration and the environment.
      返回:
      the driver to use
      从以下版本开始:
      1.4.0
    • getUrl

      public String getUrl()
      Return the configured url or null if none was configured.
      返回:
      the configured url
      另请参阅:
    • setUrl

      public void setUrl(String url)
    • determineUrl

      public String determineUrl()
      Determine the url to use based on this configuration and the environment.
      返回:
      the url to use
      从以下版本开始:
      1.4.0
    • determineDatabaseName

      public String determineDatabaseName()
      Determine the name to used based on this configuration.
      返回:
      the database name to use or null
      从以下版本开始:
      2.0.0
    • getUsername

      public String getUsername()
      Return the configured username or null if none was configured.
      返回:
      the configured username
      另请参阅:
    • setUsername

      public void setUsername(String username)
    • determineUsername

      public String determineUsername()
      Determine the username to use based on this configuration and the environment.
      返回:
      the username to use
      从以下版本开始:
      1.4.0
    • getPassword

      public String getPassword()
      Return the configured password or null if none was configured.
      返回:
      the configured password
      另请参阅:
    • setPassword

      public void setPassword(String password)
    • determinePassword

      public String determinePassword()
      Determine the password to use based on this configuration and the environment.
      返回:
      the password to use
      从以下版本开始:
      1.4.0
    • getJndiName

      public String getJndiName()
    • setJndiName

      public void setJndiName(String jndiName)
      Allows the DataSource to be managed by the container and obtained through JNDI. The URL, driverClassName, username and password fields will be ignored when using JNDI lookups.
      参数:
      jndiName - the JNDI name
    • getEmbeddedDatabaseConnection

      public EmbeddedDatabaseConnection getEmbeddedDatabaseConnection()
    • setEmbeddedDatabaseConnection

      public void setEmbeddedDatabaseConnection(EmbeddedDatabaseConnection embeddedDatabaseConnection)
    • getClassLoader

      public ClassLoader getClassLoader()
    • getXa

      public DataSourceProperties.Xa getXa()
    • setXa

      public void setXa(DataSourceProperties.Xa xa)