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

📄 savereg_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 savereg_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/savereg.jsp";from=(8,3);to=(8,35)]
         String user_name,user_password;
    // end
    // begin [file="/savereg.jsp";from=(9,3);to=(9,21)]
         Connection conn; 
    // end
    // begin [file="/savereg.jsp";from=(10,3);to=(10,18)]
         ResultSet rs; 
    // end
    // begin [file="/savereg.jsp";from=(11,3);to=(11,20)]
         Statement stmt; 
    // end

    static {
    }
    public savereg_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="/savereg.jsp";from=(0,97);to=(8,0)]
                out.write("\r\n<html>\r\n<head>\r\n<title>\r\n正在查询。。。\r\n</title>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n");

            // end
            // HTML // begin [file="/savereg.jsp";from=(8,37);to=(9,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/savereg.jsp";from=(9,23);to=(10,0)]
                out.write("\r\n");

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

            // end
            // HTML // begin [file="/savereg.jsp";from=(11,22);to=(12,0)]
                out.write("\r\n");

            // end
            // begin [file="/savereg.jsp";from=(12,2);to=(32,0)]
                
                user_name=request.getParameter("name");
                user_name=new String(user_name.getBytes("ISO-8859-1"));
                user_password=request.getParameter("pwd");
                user_password=new String(user_password.getBytes("ISO-8859-1"));
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
                conn=DriverManager.getConnection("jdbc:odbc:song"," "," ") ;
                stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE ) ;
                rs=stmt.executeQuery("select * from mycfg where name='"+user_name+"'") ;
                if (rs.next()) {
                out.println("<p align=\"center\">此用户名已存在!</p>");
                rs.close() ;
                }
                else {
                stmt.executeUpdate("insert into mycfg (name,password) values('"+user_name+"','"+user_password+"')");
                }
                stmt.close() ;
                conn.close() ;
                out.println("<p align=\"center\">注册成功!</p>");
                out.println("<p align=\"center\"><a href=\"index.jsp\">返回</a></p>");
            // end
            // HTML // begin [file="/savereg.jsp";from=(32,2);to=(35,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 + -