⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 savenew_0002ejsp_jsp.java

📁 点歌系统
💻 JAVA
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class savenew_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/savenew.jsp";from=(4,3);to=(4,19)]
        Connection conn;
    // end
    // begin [file="/savenew.jsp";from=(5,3);to=(5,16)]
        ResultSet rs;
    // end
    // begin [file="/savenew.jsp";from=(6,3);to=(6,18)]
        Statement stmt;
    // end

    static {
    }
    public savenew_0002ejsp_jsp( ) {
    }

    private static boolean _jspx_inited = false;

    public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
    }

    public void _jspService(HttpServletRequest request, HttpServletResponse  response)
        throws java.io.IOException, ServletException {

        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        HttpSession session = null;
        ServletContext application = null;
        ServletConfig config = null;
        JspWriter out = null;
        Object page = this;
        String  _value = null;
        try {

            if (_jspx_inited == false) {
                synchronized (this) {
                    if (_jspx_inited == false) {
                        _jspx_init();
                        _jspx_inited = true;
                    }
                }
            }
            _jspxFactory = JspFactory.getDefaultFactory();
            response.setContentType("text/html;charset=gb2312");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

            application = pageContext.getServletContext();
            config = pageContext.getServletConfig();
            session = pageContext.getSession();
            out = pageContext.getOut();

            // HTML // begin [file="/savenew.jsp";from=(0,98);to=(4,0)]
                out.write("\r\n<html>\r\n<head>\r\n<title>正在保存...</title>\r\n");

            // end
            // HTML // begin [file="/savenew.jsp";from=(4,21);to=(5,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/savenew.jsp";from=(5,18);to=(6,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/savenew.jsp";from=(6,20);to=(7,0)]
                out.write("\r\n");

            // end
            // begin [file="/savenew.jsp";from=(7,2);to=(9,0)]
                
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
            // end
            // HTML // begin [file="/savenew.jsp";from=(9,2);to=(12,0)]
                out.write("\r\n</head>\r\n<body>\r\n");

            // end
            // begin [file="/savenew.jsp";from=(12,0);to=(12,43)]
                {
                    String _jspx_qStr = "";
                    JspRuntimeLibrary.include(request, response, "head.jsp" + _jspx_qStr, out, true);
                    if ("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                        return;
                }
            // end
            // HTML // begin [file="/savenew.jsp";from=(12,43);to=(13,0)]
                out.write("\r\n");

            // end
            // begin [file="/savenew.jsp";from=(13,2);to=(30,0)]
                
                String s_name=request.getParameter("sname");
                s_name=new String(s_name.getBytes("ISO-8859-1"));
                String s_chr=request.getParameter("schr");
                s_chr=new String(s_chr.getBytes("ISO-8859-1"));
                String s_type=request.getParameter("stype");
                s_type=new String(s_type.getBytes("ISO-8859-1"));
                String s_pname=request.getParameter("spname");
                s_pname=new String(s_pname.getBytes("ISO-8859-1"));
                String s_count=request.getParameter("scount");
                s_count=new String(s_count.getBytes("ISO-8859-1"));
                conn=DriverManager.getConnection("jdbc:odbc:song"," "," ") ;
                stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE) ;
                String sql="insert into singer (sname,chr,stype,scount,pname) values ('"+s_name+"','"+s_chr+"','"+s_type+"','"+s_count+"','"+s_pname+"')";
                stmt.executeUpdate(sql) ;
                out.println("<p align=\"center\">添加成功!</p>");
                out.println("<p align=\"center\"><a href=\"new.jsp?currow="+request.getParameter("currow")+"\">返回</a></p>");
            // end
            // HTML // begin [file="/savenew.jsp";from=(30,2);to=(31,0)]
                out.write("\r\n");

            // end
            // begin [file="/savenew.jsp";from=(31,0);to=(31,43)]
                {
                    String _jspx_qStr = "";
                    JspRuntimeLibrary.include(request, response, "tail.jsp" + _jspx_qStr, out, true);
                    if ("true".equals(request.getAttribute("javax.servlet.forward.seen")))
                        return;
                }
            // end
            // HTML // begin [file="/savenew.jsp";from=(31,43);to=(34,0)]
                out.write("\r\n</body>\r\n</html>\r\n");

            // end

        } catch (Throwable t) {
            if (out != null && out.getBufferSize() != 0)
                out.clearBuffer();
            if (pageContext != null) pageContext.handlePageException(t);
        } finally {
            if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -