'结果集无法解析为类型'

时间:2017-08-09 16:20:02

标签: html mysql jsp jdbc resultset

我为一个查询使用了一个结果集变量,它运行正常。但是当我尝试在同一个.jsp页面中为其他查询声明更多Resultset变量时,我得到了“Resultset not resolved type”错误。

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [53] in the jsp file: [/frozen.jsp]
Resultset cannot be resolved to a type
50: }
51: avg=avg/n;
52: 
53: Resultset rs2 = stmt2.executeQuery("select amarate from amarating where movie_id='frozen'");
54: Resultset rs3 = stmt3.executeQuery("select dor,length,genre from moviedetails where movie_id='frozen'");
55: String ama = rs2.getString("amarate");
56: String dor = rs3.getString("dor");


An error occurred at line: [54] in the jsp file: [/frozen.jsp]
Resultset cannot be resolved to a type
51: avg=avg/n;
52: 
53: Resultset rs2 = stmt2.executeQuery("select amarate from amarating where movie_id='frozen'");
54: Resultset rs3 = stmt3.executeQuery("select dor,length,genre from moviedetails where movie_id='frozen'");
55: String ama = rs2.getString("amarate");
56: String dor = rs3.getString("dor");
57: String len = rs3.getString("length");


Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:212)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

0 个答案:

没有答案