java.sql.SQLException: 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 '-4,4' at line 1 Query: select id,title,author,price,sales,stock,img_path from books where 1=1 limit ?,? Parameters: [-4, 4]
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:392)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:351)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:212)
at joker.dao.BaseDao.getBeanList(BaseDao.java:97)
at joker.dao.impl.BookDaoImpl.getBooksByPage(BookDaoImpl.java:57)
at joker.service.impl.BookServiceImpl.getBookByPage(BookServiceImpl.java:50)
at joker.servlet.BookServlet.getBooksByPage(BookServlet.java:50)
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.ja
check the manual that corresponds to your MySQL server version for the right syntax to use nea异常解决方法
最新推荐文章于 2024-09-29 00:24:31 发布
当在MySQL中进行分页查询时,若LIMIT子句使用负值,会导致异常。尤其是在首页点击上一页时。解决方法是通过在代码中添加判断,如果当前页为第一页,则不显示上一页链接,同样地,对于下一页也有类似处理。
摘要由CSDN通过智能技术生成