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

📄 custom_add_deal.jsp

📁 这是我老师布置一个学习任务:保险管理系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="connDB" scope="page" class="beans.connDB"/>

<html>
 <head>
  <title>更新数据库</title>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 </head>
 <body bgcolor="#5555AA" background="pictures/background.jpg">
<jsp:include page="top.jsp"/>
   <% 
      String custom_id=request.getParameter("custom_id");
      String custom_password=request.getParameter("custom_password");
      String custom_property=request.getParameter("custom_property");
      String custom_name=request.getParameter("custom_name");
      String custom_address=request.getParameter("custom_address");
      String custom_remark=request.getParameter("custom_remark");
      String leader=request.getParameter("leader");
      String telephone=request.getParameter("telephone");
      String mobile_phone=request.getParameter("mobile_phone");
      String fax=request.getParameter("fax");
      String photo=request.getParameter("photo");
      String register_date=request.getParameter("register_date");
      String user_id=request.getParameter("user_id");
      String communicating_company=request.getParameter("communicating_company");
        
       if(custom_id==""||custom_name==""||custom_password==""||user_id=="")
         out.println("<script language='javascript'>alert('请完整输入带*的信息!');window.location.href='custom_add.jsp';</script>");
       else{
       try{
          
          ResultSet rs=connDB.executeQuery("SELECT * FROM Customer where custom_name='"+custom_name+"'"); 
          if (rs.next()){
       	      out.println("<script language='javascript'>alert('该用户名已经存在,请重新注册!');window.location.href='custom_add.jsp';</script>");
           }else{
         
              rs.last();
              String sqll="Insert into Customer (custom_id,custom_password,custom_property,custom_name,custom_address,custom_remark,leader,telephone,mobile_phone,fax,photo,register_date,user_id,communicating_company) values('"+custom_id+"','"+custom_password+"','"+custom_property+"','"+custom_name+"','"+custom_address+"','"+custom_remark+"','"+leader+"','"+telephone+"','"+mobile_phone+"','"+fax+"','"+photo+"','"+register_date+"','"+user_id+"','"+communicating_company+"')";
              connDB.executeUpdate(sqll);
         
               connDB.close();
         
              response.sendRedirect(response.encodeURL("index.jsp"));
            }
        }
        catch(SQLException e){
          e.printStackTrace();
        }
      
      }
      
    %>
    
     <tr><font color="88888CC" size="7" align="center">提示:注册成功!</font></tr>
    <tr align="right">
        <td height="100" colspan="3"><img src="pictures\2.jpg" align="middle" width="1000" height="400"> </td>
  </tr>
   
  <jsp:include page="copyright.jsp"/>
 </body>

</html>

⌨️ 快捷键说明

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