MySQL返回的消息:
10:50:14 UPDATE PMT_CN
.TMPLT
SET SHOW_RANK
= ‘0’ WHERE (TMPLT_ID
= ‘123456’) 0 row(s) affected Rows matched: 1 Changed: 0 Warnings: 0 0.000 sec
代码中拿到的结果:
int result = cardTemplateDAO.updateShowRank(showRankVO); //1
这个返回值其实和mybatis没有关系, jdbc 默认使用的是 rows matched,如果想要jdbc返回的是影响的行数,可配置这个参数:
jdbc:mysql://{jdbc.host}/{jdbc.db}?useAffectedRows=true