zoukankan      html  css  js  c++  java
  • 【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;
    
    }
  • 相关阅读:
    Path Sum
    Binary Tree Level Order Traversal II
    Jump Game
    leedcode 刷题-V2
    (2016 年) githup 博客地址 : https://github.com/JMWY/MyBlog
    算法分类总结
    剑指 Offer 题目汇总索引
    LeedCde 题解目录
    趣味算法总目录
    常用
  • 原文地址:https://www.cnblogs.com/gyjx2016/p/8569252.html
Copyright © 2011-2022 走看看