add_0005fcourse1_0002ejsp_jsp.java
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. import java.sql.*;
  2. import proj112.*;
  3. import proj112.DataFormat;
  4. import javax.servlet.*;
  5. import javax.servlet.http.*;
  6. import javax.servlet.jsp.*;
  7. import org.apache.jasper.runtime.*;
  8. public class add_0005fcourse1_0002ejsp_jsp extends HttpJspBase {
  9.     // begin [file="/add_course1.jsp";from=(4,0);to=(4,57)]
  10.     // end
  11.     static {
  12.     }
  13.     public add_0005fcourse1_0002ejsp_jsp( ) {
  14.     }
  15.     private static boolean _jspx_inited = false;
  16.     public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
  17.     }
  18.     public void _jspService(HttpServletRequest request, HttpServletResponse  response)
  19.         throws java.io.IOException, ServletException {
  20.         JspFactory _jspxFactory = null;
  21.         PageContext pageContext = null;
  22.         HttpSession session = null;
  23.         ServletContext application = null;
  24.         ServletConfig config = null;
  25.         JspWriter out = null;
  26.         Object page = this;
  27.         String  _value = null;
  28.         try {
  29.             if (_jspx_inited == false) {
  30.                 synchronized (this) {
  31.                     if (_jspx_inited == false) {
  32.                         _jspx_init();
  33.                         _jspx_inited = true;
  34.                     }
  35.                 }
  36.             }
  37.             _jspxFactory = JspFactory.getDefaultFactory();
  38.             response.setContentType("text/html; charset=gb2312");
  39.             pageContext = _jspxFactory.getPageContext(this, request, response,
  40.              "", true, 8192, true);
  41.             application = pageContext.getServletContext();
  42.             config = pageContext.getServletConfig();
  43.             session = pageContext.getSession();
  44.             out = pageContext.getOut();
  45.             // HTML // begin [file="/add_course1.jsp";from=(0,49);to=(1,0)]
  46.                 out.write("rn");
  47.             // end
  48.             // HTML // begin [file="/add_course1.jsp";from=(1,31);to=(2,0)]
  49.                 out.write("rn");
  50.             // end
  51.             // HTML // begin [file="/add_course1.jsp";from=(2,30);to=(3,0)]
  52.                 out.write("rn");
  53.             // end
  54.             // HTML // begin [file="/add_course1.jsp";from=(3,39);to=(4,0)]
  55.                 out.write("rn");
  56.             // end
  57.             // begin [file="/add_course1.jsp";from=(4,0);to=(4,57)]
  58.                 proj112.dbconn a = null;
  59.                 boolean _jspx_speciala  = false;
  60.                  synchronized (pageContext) {
  61.                     a= (proj112.dbconn)
  62.                     pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
  63.                     if ( a == null ) {
  64.                         _jspx_speciala = true;
  65.                         try {
  66.                             a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
  67.                         } catch (ClassNotFoundException exc) {
  68.                              throw new InstantiationException(exc.getMessage());
  69.                         } catch (Exception exc) {
  70.                              throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
  71.                         }
  72.                         pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
  73.                     }
  74.                  } 
  75.                 if(_jspx_speciala == true) {
  76.             // end
  77.             // begin [file="/add_course1.jsp";from=(4,0);to=(4,57)]
  78.                 }
  79.             // end
  80.             // HTML // begin [file="/add_course1.jsp";from=(4,57);to=(11,0)]
  81.                 out.write("rnrnrn<html>rn<body>rnrnrn");
  82.             // end
  83.             // begin [file="/add_course1.jsp";from=(11,2);to=(20,2)]
  84.                 
  85.                   String xqh = DataFormat.convert(request.getParameter("xqh"));
  86.                      String kch = DataFormat.convert(request.getParameter("kch"));
  87.                   String kcm = DataFormat.convert(request.getParameter("kcm"));
  88.                   String xf = DataFormat.convert(request.getParameter("xf"));
  89.                    //int age = Integer.parseInt(request.getParameter("age"));
  90.                    String zjjs = DataFormat.convert(request.getParameter("zjjs"));
  91.                 
  92.                 
  93.                   
  94.             // end
  95.             // HTML // begin [file="/add_course1.jsp";from=(20,4);to=(21,2)]
  96.                 out.write("rn  ");
  97.             // end
  98.             // begin [file="/add_course1.jsp";from=(21,4);to=(32,2)]
  99.                 
  100.                   /*
  101.                   out.print(num);
  102.                   out.print(name);
  103.                   out.print(pwd);
  104.                   out.print(addr);
  105.                   out.print(age);
  106.                   out.print(br);*/
  107.                 
  108.                   int result = a.executeUpdate("insert into chengji(xqh,kch,kcm,xf,zjjs) values('"+xqh+"','"+kch+"', '"+kcm+"', '"+xf+"', '"+zjjs+"')");
  109.                   //int result = add.executeUpdate("insert into std(num,UserName,PassWord,addr,age,bedroom) values('222', '4', '546', 'asdf', 5, 'r')");
  110.                   
  111.             // end
  112.             // HTML // begin [file="/add_course1.jsp";from=(32,4);to=(34,0)]
  113.                 out.write("rnrn");
  114.             // end
  115.             // begin [file="/add_course1.jsp";from=(34,2);to=(36,2)]
  116.                   response.sendRedirect("course.jsp");
  117.                   //out.print("插入成功!");
  118.                   
  119.             // end
  120.             // HTML // begin [file="/add_course1.jsp";from=(36,4);to=(40,0)]
  121.                 out.write("rnrn  </body>rn  </html>rn");
  122.             // end
  123.         } catch (Throwable t) {
  124.             if (out != null && out.getBufferSize() != 0)
  125.                 out.clearBuffer();
  126.             if (pageContext != null) pageContext.handlePageException(t);
  127.         } finally {
  128.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  129.         }
  130.     }
  131. }