Gentle0503 2018-02-14 03:54 采纳率: 64.7%
浏览 7931
已结题

HTTP Status 500 - Request processing failed;

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 'select group_concat(distinct

concat(
  'max(if(cname = ''',cname,
  ' at line 2

The error may exist in file [UsercourseMapping.xml]

The error may involve defaultParameterMap

The error occurred while setting parameters

SQL: set @sql = null; select group_concat(distinct concat( 'max(if(cname = ''',cname, ''', score, 0)) as ''', cname, '''' ) ) into @sql from usercourse; set @sql = concat('select uid as 学号, uname as 姓名,sum(score) as 总分, ', @sql, ' from usercourse where bid=1 group by uid '); prepare stmt from @sql; execute stmt; deallocate prepare stmt;

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 'select group_concat(distinct

concat(
  'max(if(cname = ''',cname,
  ' 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 'select group_concat(distinct
concat(
'max(if(cname = ''',cname,
' at line 2
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:963)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:91)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)

  • 写回答

4条回答

  • we82206307 2018-02-14 04:03
    关注

    你的sql有一个错误You have an error in your SQL syntax

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog