zoukankan      html  css  js  c++  java
  • 1011day人口普查系统

    1、Browse.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.edu.ia.DBUtil" %>
    <%@page import = "java.sql.*" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    String sql="select * from test";
    Connection conn= DBUtil.getConnection();
    PreparedStatement papre=conn.prepareStatement(sql);
    ResultSet rs=papre.executeQuery();
    while(rs.next()){
    out.println(rs.getString("hubie")+" &nbsp "+rs.getString("zhufang")+" &nbsp "+rs.getString("mianji")+" &nbsp "+rs.getString("fangjianshu")+" &nbsp "+rs.getString("name")+" &nbsp "+rs.getString("ID")+" &nbsp "+rs.getString("sex")+" &nbsp "+rs.getString("nation")+" &nbsp "+rs.getString("educator")+" &nbsp ");
    out.print("<br />");
    }
    %>
    <form>
    <table align="center" border="1">
    <tr>
    <td>
    <input type="submit" formaction="select.jsp" value="返回">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    2、Change.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
    </head>
    <body>
    <form action="update.jsp">
    <table align = "center" border = "1">
    <tr>
    <td>请输入要修改的户主名称:</td>
    <td>
    <input type="text" name="name">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" value="确定">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    3、delete.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.edu.ia.DBUtil" %>
    <%@page import = "java.sql.*" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    String sql="select * from people";
    Connection conn= DBUtil.getConnection();
    PreparedStatement papre=conn.prepareStatement(sql);
    ResultSet rs=papre.executeQuery();
    String n=request.getParameter("name");
    boolean s=true;
    session.setAttribute("name",n);
    while(rs.next()){
    if(n.equals(rs.getString("name"))){
    out.println(rs.getString("hubie")+" &nbsp "+rs.getString("zhufang")+" &nbsp "+rs.getString("mianji")+" &nbsp "+rs.getString("fangjianshu")+" &nbsp "+rs.getString("name")+" &nbsp "+rs.getString("ID")+" &nbsp "+rs.getString("sex")+" &nbsp "+rs.getString("nation")+" &nbsp "+rs.getString("educator")+" &nbsp ");
    out.print("<br />");
    s=false;
    }
    }
    %>
    <form action="shanchu">
    <table align = "center" border = "1">
    <tr>
    <td>请再次输入要删除的户主名称:</td>
    <td>
    <input type="text" name="name">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" value="确定">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    4、educator.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <form action="shuchu.jsp" method="get">
    <table>
    <tr>
    <td>受教育程度</td>
    <td>
    <input type="text" name="educator" list="elist">
    <datalist id="elist">
    <option>研究生</option>
    <option>大学本科</option>
    <option>大学专科</option>
    <option>高中</option>
    <option>初中</option>
    <option>小学</option>
    <option>未上过学</option>
    </datalist>
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" value="确定">
    </td>
    </table>
    </form>
    </body>
    </html>

    5、ErrorPage.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <h1>数据库内无此信息</h1>
    <form action="select.jsp" method="get">
    <input type="submit" value="返回">
    </form>
    </body>
    </html>

  • 相关阅读:
    Leetcode 1002. 查找常用字符
    Leetcode 1020. 将数组分成和相等的三个部分
    Leetcode 1021. 最佳观光组合
    Leetcode 1022. 可被 K 整除的最小整数
    算法入门经典第六章 例题6-9 天平
    例题6-7 树的层次遍历
    算法入门经典第六章 例题6-4 破损的键盘
    算法入门经典-第五章 例题5-7 丑数
    算法入门经典第六章 例题6-5 移动盒子
    算法入门经典第六章 例题6-2 铁轨
  • 原文地址:https://www.cnblogs.com/lx06/p/14165089.html
Copyright © 2011-2022 走看看