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,10’ at line 2 ### The error may exist in com/an/Dao/InfoDao.java (best guess) ### The error may involve com.an.Dao.InfoDao.selectByPage-Inline ### The error occurred while setting parameters ### SQL: SELECT * FROM infolimit ?,? ### 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,10’ at line 2 ; 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,10’ at line 2 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:634) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
原因有可能是sql语句有错或者是数据库表中的字段名与SQL中的关键字相同,这里的错是使用了和关键字同名的字段名
更改字段名就可
name,table,host,desc,table,order这些经常会被当做字段名的其实都是SQL中的关键字
别用!!!!!!!!