在用Spring Boot JPA的时候导致Statement.executeQuery() cannot issue statements that do not produce result sets
解决方法:
在@Query
上加上@Modifying
,表示不需要返回值
@Query
对应到底层jdbc框架是Statement.executeQuery()
,而@Modifying@Query
对应的是Statement.execute();
- executeQuery statements Statement produce cannotexecutequery statements statement produce syntaxerror statement outside cannot statement statement executing password before 4statement statement invalid bound found multi-statement bindingexception invalidbound statement found bindingexception ibatisbinding mybatisplus statement bindingexception selectjoball jobmapper statement