mybaits log 插件无法显示sql语句
2022/1/31 19:10:48
本文主要是介绍mybaits log 插件无法显示sql语句,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
原文链接:这里
0.前言
mybatis log插件是一款可以在mybaits中显示你最终运行的sql语句的插件,好处就是可以直接看到操作数据库的sql语句,不用再去挨个看参数了。但是从2020之后这款插件收费了。
破解版下载地址:https://box356.lanzous.com/iJ86hm00mba
1.遇到问题
这款插件一开始装的时候,运行测试文件,什么都不显示,一片空白,我一直以为是插件版本的问题,到网上下载了几个不同版本还是一样不显示,后来发现跟插件没有关系,是配置的问题。
2.解决办法
打开mybaits的配置文件,加上下面这段代码
<settings> <setting name="logImpl" value="org.apache.ibatis.logging.stdout.StdOutImpl" /> </settings>变成下面这样
<?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> <setting name="logImpl" value="org.apache.ibatis.logging.stdout.StdOutImpl" /> </settings> <environments default="development"> <environment id="development"> <transactionManager type="JDBC"></transactionManager> <dataSource type="POOLED"> <property name="driver" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://127.0.0.1:3306/myapp?characterEncoding=UTF-8"/> <property name="username" value="root"/> <property name="password" value="QWER1234asdf"/> </dataSource> </environment> </environments> <mappers> <mapper resource="com/cat/mapper/StudentsMapper.xml"/> </mappers> </configuration>再次运行测试语句发现正常能看到sql语句了。
这篇关于mybaits log 插件无法显示sql语句的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-08Sora从入门到入门-白话版1
- 2024-05-082024年github开源top100中文
- 2024-05-083、最大池化maxinmum pooling
- 2024-05-08动态规划基础思想
- 2024-05-08Kimi:文本解析利器,你相信光么?
- 2024-05-08在Windows电脑上快速运行AI大语言模型-Llama3
- 2024-05-08MoneyPrinterTurbo:一键生成短视频的AI神器
- 2024-05-08阶跃星辰:探索智能科技的星辰大海
- 2024-05-08一分钟部署 Llama3 中文大模型,没别的,就是快
- 2024-03-28smol ai