当LIMIT #{startNumber},#{showNumber}这样写时会报错。
换成LIMIT 0,10 就不会报错了。什么原因?jdbc驱动jar也换了还是报错。求解。
Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@142bec44]: name is 'MySQL'
[org.springframework.jdbc.support.SQLErrorCodesFactory] - SQL error codes for 'MySQL' found
[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] - Translating SQLException with SQL state '42000', error code '1064', message [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 ''1','15'' at line 4]; SQL was [] for task [
### 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 ''1','15'' at line 4
### The error may exist in file [D:\develop\java\tomcat\webapps\adream\WEB-INF\classes\com\dream\mapping\fixedassets\CommoditySQL.xml]
### The error may involve com.dream.fixedassets.dao.CommodityDao.commodityList-Inline
### The error occurred while setting parameters
### SQL: select * from l_commodity order BY p_number 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 ''1','15'' at line 4
]
六月 10, 2016 11:11:14 上午 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [SpringMVC] in context with path [/adream] threw exception [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 ''1','15'' at line 4
### The error may exist in file [D:\develop\java\tomcat\webapps\adream\WEB-INF\classes\com\dream\mapping\fixedassets\CommoditySQL.xml]
### The error may involve com.dream.fixedassets.dao.CommodityDao.commodityList-Inline
### The error occurred while setting parameters
### SQL: select * from l_commodity order BY p_number LIMIT ?,?