mybatis一直报语法错误
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error querying 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 ''0','25'' at line 4
### The error may exist in file [D:\tomcat7\webapps\ROOT\WEB-INF\classes\sql-mapper\puterMapper.xml]
### The error may involve com.puter.dao.puterDAO.findPuter-Inline
### The error occurred while setting parameters
### SQL: select * from tbl_puter limit ?,?
### 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 ''0','25'' at line 4
; 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 MySQL server version for the right syntax to use near ''0','25'' at line 4
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
<select id="findPuter" parameterType="map" resultMap="puterResult">
select * from tbl_puter limit #{s},#{limit}
</select>
把sql单独拿到终端是能正确执行的呢。
### Error querying 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 ''0','25'' at line 4
### The error may exist in file [D:\tomcat7\webapps\ROOT\WEB-INF\classes\sql-mapper\puterMapper.xml]
### The error may involve com.puter.dao.puterDAO.findPuter-Inline
### The error occurred while setting parameters
### SQL: select * from tbl_puter limit ?,?
### 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 ''0','25'' at line 4
; 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 MySQL server version for the right syntax to use near ''0','25'' at line 4
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
<select id="findPuter" parameterType="map" resultMap="puterResult">
select * from tbl_puter limit #{s},#{limit}
</select>
把sql单独拿到终端是能正确执行的呢。
...全文
相关推荐
mybatis 报空值异常
### MyBatis 报空值异常及解决办法在使用 MyBatis 框架进行数据库操作时,可能会遇到报空值异常的情况。
引入mybatis-plus报 Invalid bound statement错误问题的解决方法
"引入mybatis-plus报Invalid bound statement错误问题的解决方法"Mybatis-Plus是一个基于Mybatis的增强工具,旨在简化开发效率。
spring boot启动时mybatis报循环依赖的错误(推荐)
总的来说,Spring Boot启动时MyBatis报循环依赖的错误可能是由于`spring-boot-devtools`与自动配置的冲突,或者是配置文件中的MyBatis配置不完整或不正确。
在IDEA中安装MyBatis Log Plugin插件,执行mybatis的sql语句(推荐)
通过MyBatis Log Plugin,你可以得到以下关键信息:- **SQL语句**:显示最终拼接生成的SQL,包括参数绑定情况,这对于排查SQL语法错误、性能优化等非常有帮助。
MyBatis 动态拼接Sql字符串的问题
在动态SQL中,当某些条件不满足时,可能会留下多余的AND或OR,导致SQL语法错误。


Web 开发
