有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

Mybatis,Mysql中重复更新查询的java语法错误

当我使用muliple查询时,出现了语法错误

我的JDBC属性 jdbc。driverClassName=com。mysql。jdbc。驾驶员 jdbc。url=jdbc:mysql://ipadress/Project1?zeroDateTimeBehavior=convertToNull&allowMultiQueries=true

这是我的DAO、日志和代码

sqlSession.update("mapper.board.updateImage",fileList);

fileList有一个列表。这样地 list


制图员。董事会xml


<update id="updateImage" parameterType="java.util.Map" >
    <foreach collection="list" item="item" >
        update t_imageFile
        set imageFileName = #{item.imageFileName}
        where articleNO= #{item.articleNO} and imageFileNO=#{item.imageFileNO}
    </foreach>
</update>

日志

#DEBUG: mapper.board.updateImage - ==> Parameters: IMG_8F1C51A161BB-1.jpeg(String), 18(Integer), 25(Integer), IMG_F1501ECD2035-1.jpeg(String), 18(Integer), 26(Integer)

#DEBUG: org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator - Translating SQLException with SQL state '42000', error code '1064', message [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_imageFile set imageFileName = 'IMG_F1501ECD2035-1.jpeg' ' at line >5]; SQL was [] for task [

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_imageFile set imageFileName = 'IMG_F1501ECD2035-1.jpeg' ' at line 5 The error may involve mapper.board.updateImage-Inline The error occurred while setting parameters

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_imageFile set imageFileName = 'IMG_F1501ECD2035-1.jpeg at line 5 ]

有什么问题


共 (0) 个答案