为了让Mybatis打印日志,查了不少资料。回头一看很简单,一行代码搞定
application.properties
新增下面行
#mybatis start
mybatis.config-location=classpath:/mybatis-config.xml
#mybatis end
mybatis-config.xml
新增下面文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<!-- 打印SQL语句到控制台 -->
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings>
</configuration>
OK!!!
项目下载地址
https://github.com/daleiwang/moxi
Spring Boot(1)工具安装
Spring Boot(2)新建Spring Boot工程
Spring Boot(3)整合Mybatis
Spring Boot(4)整合thymeleaf
Spring Boot(5)一个极简且完整的后台框架
Spring Boot(6)jar方式打包发布
Spring Boot(7)war方式打包发布