mybatis一直报语法错误

zhuyc 2014-12-31 10:45:35
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单独拿到终端是能正确执行的呢。
...全文
1076 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
猎魔人-不纯 2014-12-31
  • 打赏
  • 举报
回复
log4jdbc3-1.2.1.jar 可以打印出带参数的sql
log4j.logger.jdbc.sqlonly=off 
log4j.logger.jdbc.sqltiming=on 
log4j.logger.jdbc.audit=off  
log4j.logger.jdbc.resultset=off 
log4j.logger.jdbc.connection=off
jdbc.driver=net.sf.log4jdbc.DriverSpy
jdbc.url=jdbc:log4jdbc:XXX
北京不不 2014-12-31
  • 打赏
  • 举报
回复
the error occurred while setting parameters select * from tbl_puter limit ?,? limit 传入的参数错误,分页有问题啊。
qzw1210 2014-12-31
  • 打赏
  • 举报
回复
看下接收的两个参数
  • 打赏
  • 举报
回复
后台接收的s应该出错了
丶雨过天晴 2014-12-31
  • 打赏
  • 举报
回复
传入分页的参数有问题
  • 打赏
  • 举报
回复
你在dao打印下limit的参数,应该是参数错了
邹邹wl 2014-12-31
  • 打赏
  • 举报
回复
你传的参数是字符类型还是整数类型?

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧