标签:tis out driver 指定 name 服务 poj lis mil
springboot 整合ssm(mysql)基础配置文件模板,包含连接池,json,mybatis,log,springcloud客户端等yml配置。
一方面避免突然忘了,另一方面方便下次使用在此基础进行修改
spring:
##druid 数据源
datasource:
url: jdbc:mysql://url:端口/test
username: root
password: 123456
driver-class-name: com.mysql.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
#初始化链接数量
initialSize: 5
#最小空闲链接数
minIdle: 5
#最大并发连接数
maxActive: 10
#获取链接等待超时的时间
maxWait: 60000
#配置间隔多久才进行一次检测,检测需要关闭的空闲链接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
#内部jackson
jackson:
#json格式
date-format: yyyy-MM-dd HH:mm:ss
#时区
time-zone: GMT+8
#集成mybatis
mybatis:
#xml路径
mapper-locations: classpath:mapper/*.xml
#pojo路径
type-aliases-package: com.demo.pojo
configuration:
#驼峰
map-underscore-to-camel-case: true
#服务器
server:
port: 8090
#日志
logging:
level:
com.woniu.dao: debug
####################Hikari####################
#spring:
# datasource:
# type: com.zaxxer.hikari.HikariDataSource
# url: jdbc:mysql://url:port/test?serverTimezone=UTC&useSSL=false
# username: root
# password: 123456
# driver-class-name: com.mysql.jdbc.Driver
# # Hikari 连接池配置
# hikari:
# # 最小空闲链接
# minimum-idle: 5
# # 空闲连接存活最大时间,默认600000(10分钟)
# idle-timeout: 180000
# # 连接池最大连接数,默认是10
# maximum-pool-size: 10
# # 此属性控制从池返回的连接的默认自动提交行为,默认值:true
# auto-commit: true
# # 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
# max-lifetime: 1800000
# # 数据库连接超时时间,默认30秒,即30000
# connection-timeout: 30000
####################druid####################
# # 连接池的配置信息:初始化大小,最小,最大
# initialSize: 1
# minIdle: 1
# maxActive: 3
# # 配置获取连接等待超时的时间
# maxWait: 60000
# # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
# timeBetweenEvictionRunsMillis: 60000
# # 配置一个连接在池中最小生存的时间,单位是毫秒
# minEvictableIdleTimeMillis: 30000
# #验证库是否正常sql
# validationQuery: select ‘x‘
# #空闲时验证,防止连接断开
# testWhileIdle: true
# testOnBorrow: false
# testOnReturn: false
# # 打开PSCache,并且指定每个连接上PSCache的大小
# poolPreparedStatements: true
# maxPoolPreparedStatementPerConnectionSize: 20
# # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,‘wall‘用于防火墙
# filters: stat,wall,slf4j
# # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
# connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
####################微服务客户端配置####################
#eureka:
# instance:
# instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
# prefer-ip-address: true
# hostname: ${spring.cloud.client.ip-address}
# client:
# service-url:
# defaultZone: http://url:端口/eureka
#
#
#ribbon:
# eureka:
# enabled: true
配置(1):springboot yml配置连接池(druid,hikari),mybatis,json,log
标签:tis out driver 指定 name 服务 poj lis mil
原文地址:https://www.cnblogs.com/cyhabc/p/12929980.html