• 【springboot】之将properties配置转为bean


    将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;
    
    }
  • 相关阅读:
    私藏实用免费软件备份
    JavaScript03-基本概念一
    JavaScript02-js使用
    JavaScript第一回-来龙去脉
    初读时间简史的零星杂想
    读《死亡诗社》
    读《生死疲劳》
    js的预解析
    浏览器事件捕获冒泡以及阻止冒泡
    http初探
  • 原文地址:https://www.cnblogs.com/gyjx2016/p/8569252.html
Copyright © 2020-2023  润新知