SpringBoot + Mybatis 在控制台输出sql语句 yml

本文档展示了如何在SpringBoot中配置Mybatis,以便在控制台输出SQL语句。通过调整logging.level属性,针对特定Mapper包路径启用debug级别日志,可以详细查看SQL执行情况。同时,配置数据源连接池参数,确保数据库连接的高效管理。此外,还配置了Mybatis-Plus的相关设置,包括Mapper文件位置和全局配置。
摘要由CSDN通过智能技术生成

server:
port: 862
servlet:
context-path: /lss
#springboot开启对jsp页面的热部署
jsp:
init-parameters:
development: true
logging:
config: classpath:logback-spring.xml
level:
com:
lsm:
mapper:
customerorder: debug # 改成你的mapper文件所在包路径//com.lsm.mpaaper.customerorder 只有sql语句和影响影响行数
spring:
datasource:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=DBModel
username: sa
password: root
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1
testWhileIdle: true
testOnBorrow: true
testOnReturn: true
poolPreparedStatements: true
maxOpenPreparedStatements: 20
resources:
static-locations: [“classpath:static”]
mybatis-plus:
mapper-locations: classpath*:sqlMap/.xml,classpath:sqlMap/customership/.xml
config-locations: classpath
:config/mybatis-config.xml
configuration:#mybatis sql语句打印及执行结果输出
mapUnderscoreToCamelCase: true
logImpl: org.apache.ibatis.logging.stdout.StdOutImpl
typeAliasesPackage: com.lsm.mapper

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值