将springboot里面非application.yml 或者application.properties 里面的key-value转为JavaBean

/**
 * @Describe: DataSource Bean
 * @Author: Hubal in 2018/2/22
 **/
@Configuration
@ConfigurationProperties(prefix = "druid")
@PropertySource(value = "classpath:config/druid.properties")
@Data
@Component
public class DruidBean {

    private int initialSize;
    private int minIdle;
    private int maxActive;
    private long maxWait;
    private long timeBetweenEvictionRunsMillis;//
    private long minEvictableIdleTimeMillis;//配置连接在池子中最小生存时间
    private String validationQuery;//检验SQL
    private Boolean testWhileIdle;
    private Boolean testOnBorrow;
    private Boolean testOnReturn;
    private Boolean poolPreparedStatements;
    private int maxPoolPreparedStatementPerConnectionSize;
    private String filters;
    private String connectionProperties;
    private Boolean useGlobalDataSourceStat;

}

 

相关文章:

  • 2021-12-08
  • 2022-01-07
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2021-11-21
  • 2021-05-08
猜你喜欢
  • 2022-01-04
  • 2021-08-28
  • 2022-12-23
  • 2022-02-08
  • 2022-01-27
  • 2022-12-23
  • 2021-07-27
相关资源
相似解决方案