The javamybatis conditional query finds that the result is empty

Problem The conditional query is found to be empty

solution

Problem Chinese encoding problem, using utf-8 can be solved

Modify the url, and replace the url with this line in the mybatis-config.xml of resources

<property name="url" value="jdbc:mysql:///mybatis?useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>

<property name="url" value="jdbc:mysql:///mybatis?useSSL=false&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>

after debugging

From Bilibili barrage boss, thanks again

Finally, I am inquiring about other methods, but the solution that does not work may be different for everyone.

查不出来的去看看mybatis-config里面的jdbc链接有没有加上&amp;characterEncoding=utf8


你那个可能是数据库中文编码问题,在连接数据库字符串加上 ?useUnicode=true&characterEncoding=gb2312

查不出来应该是编码格式问题,可以尝试在mybatis的xml文件中 的url后面加上&amp;useUnicode=true&amp;characterEncoding=UTF-8

Guess you like

Origin blog.csdn.net/Zheng_Emperor/article/details/129681702