当前位置: 代码迷 >> 综合 >> java.sql.SQLException: sql injection violation, multi-statement not allow
  详细解决方案

java.sql.SQLException: sql injection violation, multi-statement not allow

热度:103   发布时间:2023-11-04 21:36:32.0

sql涉及到批量操作,开发环境正常执行,测试环境报错

sql injection violation, multi-statement not allow : update eqc_area_cust_trend

sql:

  <foreach collection="dayList" item="item" separator=";">update xxxxset xxxxwhere xxxx </foreach>

检查后发现测试环境配置少了:

wall:multi-statement-allow: true

加上后正常运行,但是尚存的疑虑是:

url: jdbc:mysql://xxxxxxx/xxxxxx?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true

url中配置了

allowMultiQueries=true

为什么还需要另外配置multi-statement-allow: true

  相关解决方案