MySQL, MyBatis encounters a problem collection

Source: Internet
Author: User

1. Error description

Before encountering this error, it is now the version of MySQL that is 6. A few versions, the previous version of 5 did not have the problem:

Solution:

Add a. SERVERTIMEZONE=UTC after the connection string where UTC is the uniform standard world time. Complete Connection String Example: JDBC:MYSQL://LOCALHOST:3306/TEST?SERVERTIMEZONE=UTC or another option: Jdbc:mysql://127.0.0.1:3306/test? Useunicode=true&characterencoding=utf-8, this is to solve the Chinese garbled input problem, of course, can also be combined with the above: Jdbc:mysql://127.0.0.1:3306/test? Useunicode=true&characterencoding=utf-8&servertimezone=utc

2, the use of Springboot integration MyBatis when found @mapper annotations can not be used, but also because of the version of the reason, so this piece to pay attention to.

3, Error: annotation callout on the interface or implementation class, I labeled @service on the interface, the result indicates that the service class could not be found?

@Service annotations are labeled on an interface or an implementation class?

@ServiceAnnotations are labeled on the implementation class, because they @Service are spring instantiated in the container bean ,

That is, the equivalent of the new operation, only 实现类 can be new instantiated, and 接口 then not, so is added to 实现类 the.

Bottom line: The spring container is instantiated and the interface cannot be instantiated, only the implementation class can.

You can also learn from this blog:

77159213

MySQL, MyBatis encounters a problem collection

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.