(自用)application.properties配置

(仿牛客网)
#https://spring.io/
ServerProperties
server.port=8080
server.servelet.context-path=/community

#https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#appendix.application-properties
#ThymeleafProperities
spring.thymeleaf.cache=false

# DataSourceProperties
#MySQL数据库以及连接时(数据源,统一管理连接的工厂,能够统一初始化连接并且反复使用和连接上限)

#数据库驱动,这是mysql的
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver   
#mysql连接路径
spring.datasource.url=jdbc:mysql://localhost:3306/community?characterEncoding=utf-8&useSSL=false&serverTimezone=Hongkong
spring.datasource.username=root
spring.datasource.password=lihonghe
#连接时类型
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
#最大连接数
spring.datasource.hikari.maximum-pool-size=15
#最小空闲连接
spring.datasource.hikari.minimum-idle=5
#超时,空闲多久关闭连接
spring.datasource.hikari.idle-timeout=30000

# MybatisProperties
#映射文件的存放位置 classpath是target下的classes文件,在resources下建的文件都会编译到target下的classes
mybatis.mapper-locations=classpath:mapper/*.xml
#指定实体类所在包包名
mybatis.type-aliases-package=com.practice.niuke.entity
#启用自动生成主键
mybatis.configuration.useGeneratedKeys=true
#使下划线命名方式和驼峰命名方式自动匹配  header_url headerUrl字段和属性
mybatis.configuration.mapUnderscoreToCamelCase=true

# logger
#把这个包的级别调为debug,降级之后方便调试xml,会打印每次查询之前运行的sql
logging.level.com.practice=debug

##本来使用的好好的昨天一运行就出错了,一是不知道怎么回事mavean路径需要重新写,二是pom.xml重新复制了老师的文件,使得spring-boot-maven-plugin不爆红了,三是重新复制了application.properties的配置,明明是一样的,只不过之前的写了注释,然后就没问题了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值