application全局配置
# 应用名称
spring.application.name=hello_mybatis
#下面这些内容是为了让MyBatis映射
#指定Mybatis的Mapper文件
mybatis.mapper-locations=classpath:mappers/*xml
#指定Mybatis的实体目录
mybatis.type-aliases-package=cn.edu.neu.hello_mybatis.entity
# 数据库驱动:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# 数据源名称
spring.datasource.name=defaultDataSource
# 数据库连接地址
spring.datasource.url=jdbc:mysql://localhost:3306/mychina?serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
yml
server:
port: 8080
// 配置swagger
spring:
mvc:
path match:
:matching-strategy: ant_path_matcher
// 连接数据库
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/background?serverTimezone=UTC
username: root
password:
mybatis:
mapper-locations: classpath:mapper/*xml #扫描所有mybatis的xml文件
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #在控制台打印sql语句
type-aliases-package: com.duxiang.backgroundmanagement.entity
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性