求助!!!HTTP Status 500 - Request processing failed

沉梦昂志、 2021-05-27 03:47:25
运行SSM的java程序后,登录后台是出现这样的显示:
HTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLSyntaxErrorException: 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 'admin a where 1=1

and a.username = 'admin'' at line 1
### The error may exist in com/entity/admin.xml
### The error may involve com.dao.AdminDAO.getAdminByCond-Inline
### The error occurred while setting parameters
### SQL: select a.* from admin a where 1=1 and a.username = ?
### Cause: java.sql.SQLSyntaxErrorException: 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 'admin a where 1=1

and a.username = 'admin'' at line 1
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 'admin a where 1=1

and a.username = 'admin'' at line 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
...全文
139 点赞 收藏 1
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
getdate 06-16

你的SQL 在 数据库那边能执行成功么? select a.* from admin a where 1=1 and a.username = 'admin'

回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告