业务场景是,每条修改的值都不相同
dao
xml:
做到这一步还没有完;此时mysql还不支持批量修改会报错
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE weibo_content
SET
EMOTION = 0.0
W' at line 7
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE weibo_content
当时一直以为是自己的语法有误其实不是的,这是因为配置数据源的时候缺少配置
&allowMultiQueries=true这条语句允许一次提交多条sql语句。特别是分号;
完美解决,还是百度发现的