SpringBoot高级整合—Druid数据源
SpringBoot整合Druid数据源 导入依赖 < dependency > < groupId > com . alibaba < / groupId > < artifactId > druid < / artifactId > < version > 1.1 .21 < / version > < / dependency > 配置数据库以及数据源的相关属性 spring : datasource : password : root username : root url : jdbc : mysql : //127.0.0.1 : 3307/db_book_system ? characterEncoding=utf8 &useSSL =false &serverTimezone =UTC &rewriteBatchedStatements =true driver-class-name : com.mysql.jdbc.Driver type : com.alibaba.druid.pool.DruidDataSource # 连接池的配置信息 # 初始化大小,最小,最大 initial-size : 5 min-idle : 5 maxActive : 20 # 配置获取连接等待超时的时间 maxWait : 60000 # 配置间隔多久才进行一次检测