?? registernetmember_jsp.java
字號:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
public final class RegisterNetMember_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
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;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write('\n');
out.write('\n');
out.write('\n');
out.write('\n');
out.write("\n");
out.write("\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
out.write("\n");
out.write("<html>\n");
out.write(" <head>\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
out.write(" <title>網上銀行</title>\n");
out.write(" </head>\n");
out.write(" <body background=\"D:/YJ/YJ1.23/NetBank/background/b100.gif\">\n");
out.write(" <font face=\"隸書\" color=\"blue\" size=3>\n");
out.write(" ");
String userName=request.getParameter("userName"); String userPassword = request.getParameter("userPassword"); String reUserPassword=request.getParameter("rePassword"); String servicePassword = request.getParameter("servicePassword"); String reServicePassword=request.getParameter("reServicePassword"); String accountID = " "+request.getParameter("accountID"); String IDcard = request.getParameter("ID"); String accountPassword = request.getParameter("accountPassword"); String address = request.getParameter("address"); String phone = request.getParameter("phone"); String mobile = request.getParameter("mobile"); String email = request.getParameter("email"); if(!userPassword.equals(reUserPassword)) {
out.write("\n");
out.write(" <p align = \"center\">\n");
out.write(" 兩次輸入的登陸密碼不一致,請重新輸入\n");
out.write(" <p align = \"center\">\n");
out.write(" <a href = \"Register.html\">回到注冊界面</a>\n");
out.write(" <meta http-equiv=\"refresh\" content=\"2; URL=Register.html\">\n");
out.write(" ");
} else if(!servicePassword.equals(reServicePassword)) {
out.write("\n");
out.write(" <p align = \"center\">\n");
out.write(" 兩次輸入的服務密碼不一致,請重新輸入\n");
out.write(" <p align = \"center\">\n");
out.write(" <a href = \"Register.html\">回到注冊界面</a>\n");
out.write(" <meta http-equiv=\"refresh\" content=\"2; URL=Register.html\">\n");
out.write(" ");
} else { String dbUrl = "jdbc:odbc:afei"; String user = "scott"; String password = "tiger"; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn = DriverManager.getConnection(dbUrl,user,password); String sql = "Select * from deAccount where accountID = '"+accountID+"'"; Statement stat = conn.createStatement(); ResultSet result = stat.executeQuery(sql); if(!result.next()) {
out.write("\n");
out.write(" <p align = \"center\">\n");
out.write(" 對不起,您輸入的帳號不存在! 請重新輸入\n");
out.write(" <p align = \"center\">\n");
out.write(" <a href = \"Register.html\">回到注冊界面</a>\n");
out.write(" <meta http-equiv=\"refresh\" content=\"2; URL=Register.html\">\n");
out.write(" ");
} else { String sql1 = "Select * from deAccount where accountID = '"+accountID+"' and IDcard = '"+IDcard+"'"; ResultSet result1 = stat.executeQuery(sql1); if(!result1.next()) {
out.write("\n");
out.write(" <p align = \"center\">\n");
out.write(" 對不起,您輸入的帳號和身份證號不匹配! 請重新輸入\n");
out.write(" <p align = \"center\">\n");
out.write(" <a href = \"Register.html\">回到注冊界面</a>\n");
out.write(" <meta http-equiv=\"refresh\" content=\"2; URL=Register.html\">\n");
out.write(" ");
} else { String sql2 = "Select * from deAccount where accountID = '"+accountID+"' and IDcard = '"+IDcard+"' and accountPassword='"+accountPassword+"'"; ResultSet result2 = stat.executeQuery(sql2); if(!result2.next()) {
out.write("\n");
out.write(" <p align = \"center\">\n");
out.write(" 對不起,您輸入的密碼錯誤! 請重新輸入\n");
out.write(" <p align = \"center\">\n");
out.write(" <a href = \"Register.html\">回到注冊界面</a>\n");
out.write(" <meta http-equiv=\"refresh\" content=\"2; URL=Register.html\">\n");
out.write(" ");
} else { CallableStatement proc = conn.prepareCall("{ call InsertNetMember(?,?,?,?,?,?,?,?) }"); proc.setString(1, userName); proc.setString(2, userPassword); proc.setString(3,servicePassword); proc.setString(4, accountID); proc.setString(5, IDcard); proc.setString(6,phone); proc.setString(7, mobile); proc.setString(8, email); proc.execute(); proc.close(); conn.close(); } } }
out.write("\n");
out.write(" <p align = \"center\">\n");
out.write(" 祝賀您注冊成功\n");
out.write(" <meta http-equiv=\"refresh\" content=\"2; URL=Login.html\">\n");
out.write(" ");
} catch(Exception connectException) { out.println(connectException); out.println("連接數據庫失敗,請聯系管理員!"); } }
out.write("\n");
out.write(" </font>\n");
out.write(" </body>\n");
out.write("</html>\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -