因为业务需要,写了批量插入接口,一直在报The error occurred while setting parameters,但是单次插入是没问题的,最后浪费了两个小时时间,才找到原因,原来是数据库连接上需要加&allowMultiQueries=true,mybatis才能执行批量sql,坑死我了。
这个也可能报错:Translating SQLException with SQL state '42000', error code '1064'
因为业务需要,写了批量插入接口,一直在报The error occurred while setting parameters,但是单次插入是没问题的,最后浪费了两个小时时间,才找到原因,原来是数据库连接上需要加&allowMultiQueries=true,mybatis才能执行批量sql,坑死我了。
这个也可能报错:Translating SQLException with SQL state '42000', error code '1064'