springboot的一些配置

#当循环调用时,就会报错
spring.main.allow-circular-references=true
#配置mvc是需要使用一个@EnableWebMvc,不使用添加下面的配置即可
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
#开启驼峰命名
mybatis-plus.configuration.map-underscore-to-camel-case=true
#mybatis-plus 开启与关闭 SQL 日志打印,后面是前缀
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.global-config.db-config.table-prefix=ms_
spring:
datasource:
username: root
password: admin
#?serverTimezone=UTC解决时区的报错
url: jdbc:mysql://localhost:3306/mybatis?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource #Spring Boot 默认是不注入这些属性值的,需要自己绑定
#druid 数据源专有配置
initialSize: 5
minIdle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true #配置监控统计拦截的filters,stat:监控统计、log4j:日志记录、wall:防御sql注入
#如果允许时报错 java.lang.ClassNotFoundException: org.apache.log4j.Priority
#则导入 log4j 依赖即可,Maven 地址:https://mvnrepository.com/artifact/log4j/log4j
filters: stat,wall,log4j
maxPoolPreparedStatementPerConnectionSize: 20
useGlobalDataSourceStat: true
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500 mybatis:
type-aliases-package: nuc.ss.pojo
mapper-locations: classpath:mapper/*.xml

最新文章

  1. 安装Windows更新程序遇到错误:0x80070422
  2. 结婚虽易,终老不易:EntityFramework和AutoMapper的婚后生活
  3. 【001:go语言的一些语法基础】
  4. jQuery概述
  5. JAVA的单例模式与延时加载
  6. Sphinx的配置和使用
  7. 使用BroadcastReceiver实现开机自动运行的Service
  8. ios入门之c语言篇——基本函数——3——判断日期是一年的第几天
  9. UIViewController的生命周期及iOS程序执行顺序
  10. 兼容不同浏览器的 CSS Hack 写法
  11. 【翻译】在Visual Studio中使用Asp.Net Core MVC创建第一个Web Api应用(二)
  12. Update关联查询不走索引,效率低下
  13. sc.exe用法详解
  14. 《Java程序设计》 第一周学习总结
  15. 一次完整的HTTP事务是怎样一个过程?(转)
  16. windows特殊文件或文件夹
  17. 【SP1811】LCS - Longest Common Substring
  18. 2017-2018-2 1723 『Java程序设计』课程 结对编程练习-四则运算-最后阶段
  19. 【View】之【SimplePillarsView】可多色可圆角柱状图【demo】
  20. 字典树---2001 POJ Shortest Prefixes(找最短前缀)

热门文章

  1. NLP教程(6) - 神经机器翻译、seq2seq与注意力机制
  2. Maven生成可以直接执行的jar包
  3. 爬取豆瓣喜剧类热门TOP60的电影
  4. CF1682F MCMF?
  5. 行列式&矩阵树定理
  6. 在windows下使用s3cmd和s3browser来管理amazon s3的笔记
  7. Clickhouse实时数仓建设
  8. npm错误:Cannot find module ‘compression-webpack-plugin
  9. 《HALCON数字图像处理》第三章笔记
  10. 聊聊消息中间件(1),AMQP那些事儿