HTTP Status 500 - Unable to compile class for JSP
org.apache.jasper.JasperException:UnabletocompileclassforJSP:Anerroroccurredatline:37...
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 37 in the jsp file: /mkfriend/register.jsp
executeUpdate cannot be resolved or is not a field
34: try{
35: con=DriverManager.getConnection ("jdbc:sqlserver://localhost:1433;DatabaseName=Warehouse","sa","sa");
36: sql=con.createStatement();
37: sql.executeUpdate=("INSERT INTO u_user(ID) VALUES('"+ID+"')");
38: con.close();
39: }
40: catch(SQLException e)
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
求教哪里错了。。。。 展开
An error occurred at line: 37 in the jsp file: /mkfriend/register.jsp
executeUpdate cannot be resolved or is not a field
34: try{
35: con=DriverManager.getConnection ("jdbc:sqlserver://localhost:1433;DatabaseName=Warehouse","sa","sa");
36: sql=con.createStatement();
37: sql.executeUpdate=("INSERT INTO u_user(ID) VALUES('"+ID+"')");
38: con.close();
39: }
40: catch(SQLException e)
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
求教哪里错了。。。。 展开
1个回答
推荐于2016-01-31
展开全部
错误提示:37行“sql.executeUpdate=("INSERT INTO u_user(ID) VALUES('"+ID+"')");
”这里有问题,你的sql语句有问题。
”这里有问题,你的sql语句有问题。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询