mybatis批量更新报错 org.springframework.jdbc.BadSqlGrammarException: ### Error updating

java.util.concurrent.ExecutionException: org.springframework.jdbc.BadSqlGrammarException: ### 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 MariaDB server version for the right syntax to use near 'update excel_mobile_message_record set excel_id= 319, return_code = ‘呼叫限’ at line 3 ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ; update excel_mobile_message_record set excel_id= ?, return_code = ? where id = ? ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'update excel_mobile_message_record set excel_id= 319, return_code = ‘呼叫限’ at line 3 ; 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 MariaDB server version for the right syntax to use near 'update excel_mobile_message_record set excel_id= 319, return_code = ‘呼叫限’ at line 3 at

解决办法:
未开启批量更新
spring.datasource.url=jdbc:mysql://
spring.datasource.default-auto-commit=true
spring.datasource.username=
spring.datasource.password=**********
spring.datasource.initial-size=2
spring.datasource.max-active=20
spring.datasource.min-idle=1
spring.datasource.max-idle=10
spring.datasource.max-wait=60000
spring.datasource.time-between-eviction-runs-millis=3000
spring.datasource.min-evictable-idle-time-millis=300000
spring.datasource.validation-query=select 1
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
spring.datasource.poolPreparedStatements=true
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.remove-abandoned=true
spring.datasource.remove-abandoned-timeout=180
spring.datasource.connection-properties=clientEncoding=UTF-8;allowMultiQueries=true
spring.datasource.driverClassName=com.mysql.jdbc.Driver

设置加粗字体

你可能感兴趣的:(spring报错解决)