日期:2014-05-18  浏览次数:20756 次

JSP表单信息输入数据库的问题.
代码为:
<%   String   num=request.getParameter( "num ");
      String   typeid=request.getParameter( "typeid ");
      String   seno=request.getParameter( "seno ");
      String   eno=request.getParameter( "eno ");
      String   wdate=request.getParameter( "wdate ");
      String   ano=request.getParameter( "ano ");
String   sql= "insert   into   pageinfo(num,typeid,seno,eno,wdate,ano)    
values( ' "+num+ " ', ' "+typeid+ " ', ' "+seno+ " ', ' "+eno+ " ', ' "+wdate+ " ', ' "+ano+ " ')   ";
    addx.executeUpdate(sql);
try{     sqlBean   db   =new   sqlBean();  
                        db.executeUpdate(sql);
                    }  
                catch(Exception   e){System.out.print(e.toString());}
    out.println( "ok ");
    response.sendRedirect( "fu.jsp ");
  %>
错误为
org.apache.jasper.JasperException:   Unable   to   compile   class   for   JSP:  

An   error   occurred   at   line:   16   in   the   jsp   file:   /biyesheji/nixie/addx.jsp
String   literal   is   not   properly   closed   by   a   double-quote
13:         String   eno=request.getParameter( "eno ");
14:         String   wdate=request.getParameter( "wdate ");
15:         String   ano=request.getParameter( "ano ");
16:   String   sql= "insert   into   pageinfo(num,typeid,seno,eno,wdate,ano)    
17:   values( ' "+num+ " ', ' "+typeid+ " ', ' "+seno+ " ', ' "+eno+ " ', ' "+wdate+ " ', ' "+ano+ " ')   ";
18:       addx.executeUpdate(sql);
19:   try{     sqlBean   db   =new   sqlBean();  


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


求助高手帮忙

------解决方案--------------------
是不是类型不对啊 如果数据库中num是int型的 那么用 ' '把它括起来肯定是错的
关于继承jtable的有关问题