MyBatis Console Print SQL statements

Source: Internet
Author: User

In fact, it is very simple to print SQL only need to add a setting on it. The pro-test is available.

Mybatis-config.xml:

<settings>
<setting name= "cacheenabled" value= "true"/>
<!--print SQL logs--
<setting name= "Logimpl" value= "stdout_logging"/>
</settings>
<typeAliases>
<!--Specify the entity class name scan package, Mapper.xml file only need to write the name of the entity classes, not case-sensitive
<package name= "Com.renrenhua.user.entity"/>
</typeAliases>

MyBatis Log Printing method more, SLF4J | log4j | Log4j2 | jdk_logging | commons_logging | stdout_logging | No_logging, can be configured according to your needs

MyBatis Console Print SQL statements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.