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

📄 registeryanzh_0002ejsp_jsp.java

📁 网上书店,JSP,MYSQL,struct,spring,hibernate
💻 JAVA
字号:
import java.sql.*;
import java.util.Properties;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;


public class RegisterYanzh_0002ejsp_jsp extends HttpJspBase {

    // begin [file="/RegisterYanzh.jsp";from=(3,3);to=(9,0)]
        
           public String convert(String s){
            try{
             	return new String(s.getBytes("ISO-8859-1"),"GB2312");
            }catch(Exception e){return null;}
           }
    // end

    static {
    }
    public RegisterYanzh_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=GBK");
            pageContext = _jspxFactory.getPageContext(this, request, response,
            			"", true, 8192, true);

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

            // HTML // begin [file="/RegisterYanzh.jsp";from=(0,48);to=(1,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/RegisterYanzh.jsp";from=(1,30);to=(2,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/RegisterYanzh.jsp";from=(2,41);to=(3,0)]
                out.write("\r\n");

            // end
            // HTML // begin [file="/RegisterYanzh.jsp";from=(9,2);to=(12,0)]
                out.write("\r\n<html>\r\n<body>\r\n");

            // end
            // begin [file="/RegisterYanzh.jsp";from=(12,2);to=(38,0)]
                
                String t_username=(String)request.getParameter("username");
                System.out.println(t_username);
                String t_password=(String)request.getParameter("password");
                String t_realname=convert((String)request.getParameter("realname"));
                String t_sex=convert((String)request.getParameter("sex"));
                String t_email=convert((String)request.getParameter("email"));
                String t_postcode=(String)request.getParameter("postcode");
                String t_address=convert((String)request.getParameter("address"));
                String t_telephone=(String)request.getParameter("telephone");
                String sql="insert into users(username,password,realname,sex,Email,postcode,address,telephone) values('"
                				+t_username+"','"+t_password+"','"+t_realname+"','"+t_sex+"','"+t_email
                				+"','"+t_postcode+"','"+t_address+"','"+t_telephone+"')";
                try{
                	Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
                	Connection con=DriverManager.getConnection("jdbc:odbc:Shopping","","");
                	Statement st=con.createStatement();
                	int rs=st.executeUpdate(sql) ;
                	if(rs!=0){
                		out.println("注册成功!");
                	}
                	else out.println("很抱歉,注册失败,请重新注册!") ;
                	st.close() ;
                	con.close() ;
                	}
                catch(Exception e){System.out.println(e.getMessage() ) ;}
            // end
            // HTML // begin [file="/RegisterYanzh.jsp";from=(38,2);to=(41,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 + -