Mybatis 批量update error

错误详细:###

    ### Error updating database.  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 t_point_send_log_201704
                     SET send_status = 5, chan' at line 16

分析异常:##

大概意思是说出现了一个语法错误

检查sql:###

update t_point_send_log_201704 SET send_status = ?, channel_type = ?, platform_type = ? where send_status = ? and point_group = ? and send_number = ? ; update t_point_send_log_201704 SET send_status = ?, channel_type = ?, platform_type = ? where send_status = ? and point_group = ? and send_number = ? ; update t_point_send_log_201704 SET send_status = ?, channel_type = ?, platform_type = ? where send_status = ? and point_group = ? and send_number = ? ; update t_point_send_log_201704 SET send_status = ?, channel_type = ?, platform_type = ? where send_status = ? and point_group = ? and send_number = ?

sql未出现语法错误

检查参数:###

5(Byte), marketing(String), 2(Byte), 5(Byte), test4_2017-04-19 00:03:23(String), liqiaomu@huize.com(String), 5(Byte), marketing(String), 2(Byte), 5(Byte), test4_2017-04-19 00:03:23(String), liubin@huize.com(String), 5(Byte), marketing(String), 1(Byte), 5(Byte), test4_2017-04-19 00:03:23(String), lining@huize.com(String), 5(Byte), marketing(String), 1(Byte), 5(Byte), test4_2017-04-19 00:03:23(String), chenhuan@huize.com(String)

参数未发现异常,也没有NULL的值

没办法,google下:###

原来是mysql默认是不支持批量update,需要加allowMultiQueries参数

参考stackoverflow

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1. Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语...
    子非鱼_t_阅读 31,742评论 18 399
  • 什么是数据库? 数据库是存储数据的集合的单独的应用程序。每个数据库具有一个或多个不同的API,用于创建,访问,管理...
    chen_000阅读 4,053评论 0 19
  • MySQL技术内幕:InnoDB存储引擎(第2版) 姜承尧 第1章 MySQL体系结构和存储引擎 >> 在上述例子...
    沉默剑士阅读 7,458评论 0 16
  • 当你想要放弃了,一定要想想那些睡得比你晚、起的比你早、跑的比你卖力、天赋还比你高德牛人,他们早已在晨光中跑向那个你...
    李晶_2c5d阅读 350评论 0 0
  • 第一次读书会,本来安排了儿子由老公带,自己在家好好跟老师们交流学习。但突发状况,读书会期间都在路上奔波。刚刚...
    8946d7fd77e0阅读 316评论 0 0