古越剑箫

学习是一种习惯

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

将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;

}

 

posted on 2018-03-14 18:12  古越剑箫  阅读(1526)  评论(0编辑  收藏  举报