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