目录
1.系统设计前准备:
2.注册页面:
3.增加页面:
4.删除页面:
5.修改页面:
6.查询页面:
7.回收站页面:
8.功能主页面:
题目:设计一个简单的网上名片管理系统,实现名片的增、删、改、查及回收站等操作。
1.用户登录与注册模块
系统的使用者必须是注册用户,一个注册用户需要注册的信息有:用户登录名、密码、用户真实名字等信息。该模块具有两个功能:
(1)用户登录:在登录时,如果用户名和密码正确,进入系统页面。
(2)用户注册:新用户应该先注册,然后再登录该系统。
2.名片管理模块
一个名片包含信息有:序号(id)、姓名(name)、性别(sex)、电话(tel)等有关信息,需要完成对名片有关的管理操作,主要有:
(1)增加名片:增加名片信息到数据库内。
(2)修改名片:修改名片信息。
(3)查询名片:以模糊查询方式查询名片。
(4)删除名片:名片的删除由2种方式,即把名片移到回收站,把名片彻底删除。
(5)浏览/查询:可以模糊查询、浏览目前有效的名片。
3.回收站管理模块
(1)还原:把回收站中的名片还原回收。
(2)彻底删除:把名片彻底从回收站删除。
(3)浏览/查询:可以模糊查询、浏览回收站中的名片。
注:序号(id)在此名片表中具有唯一性,不可重复。
完全版:JavaWeb程序设计———名片管理系统_不知迷踪的博客-CSDN博客https://blog.csdn.net/weixin_59798969/article/details/125727693?spm=1001.2014.3001.5502
1.系统设计前准备:
(1)所用技术:HTML+JSP+MySQL+JDBC(可使用CSS和JavaScript优化美观页面)
(2)使用环境:Eclipse
(3)MySQL端口号:13306(此为自己设置的,大部分为3306)
(4)创建数据库(root01)
该数据库下有三个表,如下:
2.注册页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
已有用户登录页面 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%> 已有用户登录页面 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
新用户注册页面 已有账号?立即登录 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>新用户注册页面 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
账号密码验证页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from root01_01 where root1=?"; PreparedStatement pst1=conn.prepareStatement(sql1); String name11=request.getParameter("name01"); String root11=request.getParameter("root01"); String password11=request.getParameter("password01"); pst1.setString(1, root11); ResultSet rs=pst1.executeQuery(); if(rs.next()) { out.println("该用户已存在,去登陆吧!"); //response.sendRedirect("A_register02.jsp");//直接跳转到登录页面 response.setHeader("refresh", "3;url=A_main_A_register02.jsp");//3秒自动刷新并跳转到登录页面 } else{ String sql2="insert into root01_01(name1,root1,password1) values(?,?,?)"; PreparedStatement pst2=conn.prepareStatement(sql2); pst2.setString(1, name11); pst2.setString(2, root11); pst2.setString(3, password11); int n=pst2.executeUpdate(); if(n!=0){ out.println("注册"+n+"条用户成功,去登陆吧!"); response.setHeader("refresh", "3;url=A_main_A_register02.jsp"); }else{ out.println("注册失败!"); } if(pst2!=null) pst2.close(); } if(rs!=null) rs.close(); if(pst1!=null) pst1.close(); if(conn!=null) conn.close(); %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
已有用户登录验证页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from root01_01 where root1=? and password1=?"; PreparedStatement pst1=conn.prepareStatement(sql1); String root12=request.getParameter("root02"); String password12=request.getParameter("password02"); pst1.setString(1, root12); pst1.setString(2, password12); ResultSet rs=pst1.executeQuery(); if(rs.next()) { out.println("欢迎使用!页面即将跳转!"); response.setHeader("refresh", "2;index_main.jsp");//2秒自动刷新并跳转到登录页面 }else { out.println("用户不存在或账号密码错误!"); response.setHeader("refresh", "2;A_main_A_register02.jsp"); } if(rs!=null) rs.close(); if(pst1!=null) pst1.close(); if(conn!=null) conn.close(); %>
3.增加页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
添加提交页面 请填写添加的记录:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
添加解析页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from idcard where id=?"; PreparedStatement pst1=conn.prepareStatement(sql1); int id13=Integer.parseInt(request.getParameter("id03")); String name13=request.getParameter("name03"); String sex13=request.getParameter("sex03"); int tel13=Integer.parseInt(request.getParameter("tel03")); pst1.setInt(1, id13); ResultSet rs=pst1.executeQuery(); if(rs.next()) { out.println("该用户ID已存在!"); if(conn!=null) conn.close(); if(pst1!=null) pst1.close(); if(rs!=null) rs.close(); response.setHeader("refresh","2;insert01.jsp"); }else { String sql2="insert into idcard(id,name,sex,tel) values(?,?,?,?)"; PreparedStatement pst2=conn.prepareStatement(sql2); pst2.setInt(1, id13); pst2.setString(2, name13); pst2.setString(3, sex13); pst2.setInt(4, tel13); int n=pst2.executeUpdate(); if(n!=0){ out.println("添加"+n+"条记录成功!"); }else{ out.println("添加失败!"); response.setHeader("refresh","2;insert02.jsp"); } if(pst2!=null) pst2.close(); if(conn!=null) conn.close(); if(pst1!=null) pst1.close(); if(rs!=null) rs.close(); out.println("是否具需添加?(yes/no)"); %> <%} %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
循环添加页面 <% String x=request.getParameter("x1"); if(x.equals("yes")){ response.sendRedirect("insert01.jsp"); } else if(x.equals("no")){ out.println("添加结束!"); } else { out.println("请求非法!"); } %>
4.删除页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
删除提交页面 请选择删除条件:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
删除操作页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from idcard where id=?"; PreparedStatement pst1=conn.prepareStatement(sql1); int id44=Integer.parseInt(request.getParameter("id04")); pst1.setInt(1, id44); ResultSet rs=pst1.executeQuery(); if(rs.next()) { int id14=rs.getInt("id"); String name14=rs.getString("name"); String sex14=rs.getString("sex"); int tel14=rs.getInt("tel"); String sql2="insert into recycle(id,name,sex,tel) values(?,?,?,?)"; PreparedStatement pst2=conn.prepareStatement(sql2); pst2.setInt(1, id14); pst2.setString(2, name14); pst2.setString(3, sex14); pst2.setInt(4, tel14); int n2=pst2.executeUpdate(); if(n2!=0){ out.println("回收站添加"+n2+"条记录!"); }else{ out.println("回收站添加失败!"); } if(pst2!=null) pst2.close(); String sql3="delete from idcard where id=?"; PreparedStatement pst3=conn.prepareStatement(sql3); pst3.setInt(1, id44); int n3=pst3.executeUpdate(); if(n3!=0){ out.println("删除"+n3+"条记录!"); }else{ out.println("删除失败!"); } if(pst3!=null) pst3.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); } else{ out.println("删除失败!"); if(conn!=null) conn.close(); if(rs!=null) rs.close(); } %>
5.修改页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
修改提交页面 请选择修改记录满足的条件:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
修改解析页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); int id_up=Integer.parseInt(request.getParameter("id_up")); session.setAttribute("id_up", id_up); String sql="select * from idcard where id=?"; PreparedStatement pst=conn.prepareStatement(sql); pst.setInt(1, id_up); ResultSet rs=pst.executeQuery(); if(rs.next()) {%> <% if(rs!=null) rs.close(); if(pst!=null) pst.close(); if(conn!=null) conn.close(); } else { out.println("未找到记录!"); if(rs!=null) rs.close(); if(pst!=null) pst.close(); if(conn!=null) conn.close(); response.setHeader("refresh", "2;url=update01.jsp"); } %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
修改操作页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from idcard where id=?"; PreparedStatement pst1=conn.prepareStatement(sql1); int id2=Integer.parseInt(request.getParameter("id1")); String name2=request.getParameter("name1"); String sex2=request.getParameter("sex1"); int tel2=Integer.parseInt(request.getParameter("tel1")); int id_up=(int)session.getAttribute("id_up"); pst1.setInt(1, id2); ResultSet rs=pst1.executeQuery(); if(rs.next()) { out.println("该用户已存在,请重新填写!"); if(conn!=null) conn.close(); if(pst1!=null) pst1.close(); if(rs!=null) rs.close(); response.setHeader("refresh", "2;update01.jsp"); } else { String sql2="update idcard set id=?,name=?,sex=?,tel=? where id=?"; PreparedStatement pst2=conn.prepareStatement(sql2); pst2.setInt(1, id2); pst2.setString(2, name2); pst2.setString(3, sex2); pst2.setInt(4, tel2); pst2.setInt(5, id_up); int n=pst2.executeUpdate(); if(n!=0){ out.println("修改了"+n+"条数据!"); if(pst2!=null) pst2.close(); if(conn!=null) conn.close(); if(pst1!=null) pst1.close(); if(rs!=null) rs.close(); }else{ out.println("修改失败,请重新修改!"); if(pst2!=null) pst2.close(); if(conn!=null) conn.close(); if(pst1!=null) pst1.close(); if(rs!=null) rs.close(); } } %>
6.查询页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
查询选择页面 请填写查询的内容:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
查询页面 <% request.setCharacterEncoding("UTF-8"); String x=request.getParameter("rad1"); if(x.equals("1")) {%>
<%} else if(x.equals("2")) {%>
<%} else if(x.equals("3")) {%>
<%} else { response.sendRedirect("query06.jsp"); } %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
学号查询页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from idcard where id like '%"; String sql2=request.getParameter("id07"); String sql3="%'"; String sql=sql1+sql2+sql3; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
姓名查询页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from idcard where name like '%"; String sql2=request.getParameter("name07"); String sql3="%'"; String sql=sql1+sql2+sql3; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
电话查询页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from idcard where tel like '%"; String sql2=request.getParameter("tel07"); String sql3="%'"; String sql=sql1+sql2+sql3; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
查询全部人员页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql="select * from idcard"; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %>
7.回收站页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站页面 请填写回收站查询的内容:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
回收站填写页面 回收站页面:
<% request.setCharacterEncoding("UTF-8"); String x=request.getParameter("rad2"); if(x.equals("1")) {%>
<%} else if(x.equals("2")) {%>
<%} else if(x.equals("3")) {%>
<%} else { response.sendRedirect("recycle06.jsp"); } %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站学号模糊查询 回收站页面:
<% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from recycle where id like '%"; String sql2=request.getParameter("id08"); String sql3="%'"; String sql=sql1+sql2+sql3; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站姓名模糊查询 回收站页面:
<% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from recycle where id like '%"; String sql2=request.getParameter("name08"); String sql3="%'"; String sql=sql1+sql2+sql3; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站电话模糊查询 回收站页面:
<% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/";//端口号为13306 String dbname="root01";//密码库root01 String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from recycle where id like '%"; String sql2=request.getParameter("tel08"); String sql3="%'"; String sql=sql1+sql2+sql3; PreparedStatement pst=conn.prepareStatement(sql); ResultSet rs=pst.executeQuery(); rs.last();%><% if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站查询全部页面 回收站页面:
<% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from recycle"; PreparedStatement pst1=conn.prepareStatement(sql1); ResultSet rs=pst1.executeQuery(); rs.last();%> <% if(rs!=null){rs.close();} if(pst1!=null){pst1.close();} if(conn!=null){conn.close();} %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站单个删除页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql="delete from recycle where id=?"; PreparedStatement pst=conn.prepareStatement(sql); pst.setInt(1, (int)session.getAttribute("id18")); int n=pst.executeUpdate(); if(n!=0) { out.println("删除"+n+"条记录成功!"); } else { out.println("删除失败!"); } if(pst!=null) pst.close(); if(conn!=null) conn.close(); response.setHeader("refresh", "2;url=recycle01.jsp"); %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站单个还原页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql="select * from recycle where id=?"; PreparedStatement pst=conn.prepareStatement(sql); pst.setInt(1, (int)session.getAttribute("id18")); ResultSet rs=pst.executeQuery(); PreparedStatement pst2=null; PreparedStatement pst3=null; if(rs.next()) { int id15=rs.getInt("id"); String name15=rs.getString("name"); String sex15=rs.getString("sex"); int tel15=rs.getInt("tel"); String sql2="insert into idcard(id,name,sex,tel) values(?,?,?,?)"; pst2=conn.prepareStatement(sql2); pst2.setInt(1, id15); pst2.setString(2, name15); pst2.setString(3, sex15); pst2.setInt(4, tel15); String sql3="delete from recycle where id=?"; pst3=conn.prepareStatement(sql3); pst3.setInt(1, id15); pst3.execute(); int n2=pst2.executeUpdate(); if(n2!=0){ out.println("回收站还原成功,名片添加"+n2+"条记录!"); }else{ out.println("回收站还原失败!"); } } if(pst!=null) pst.close(); if(conn!=null) conn.close(); if(pst2!=null) pst2.close(); if(pst3!=null) pst3.close(); if(rs!=null) rs.close(); response.setHeader("refresh", "2;url=recycle01.jsp"); %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站全部删除页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from recycle"; PreparedStatement pst1=conn.prepareStatement(sql1); ResultSet rs=pst1.executeQuery(); PreparedStatement pst2=null; PreparedStatement pst3=null; int sum=0; while(rs.next()) { int id15=rs.getInt("id"); String name15=rs.getString("name"); String sex15=rs.getString("sex"); int tel15=rs.getInt("tel"); String sql3="delete from recycle where id=?"; pst3=conn.prepareStatement(sql3); pst3.setInt(1, id15); pst3.execute(); pst3.executeUpdate(); sum++; } if(true) { out.println("已全部删除"+sum+"条记录!"); } if(pst3!=null) pst3.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); if(pst1!=null) pst1.close(); response.setHeader("refresh", "2;url=recycle01.jsp"); %><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
回收站全部还原页面 <% request.setCharacterEncoding("UTF-8"); Class.forName("com.mysql.jdbc.Driver"); String url1="jdbc:mysql://localhost:13306/"; String dbname="root01"; String url=url1+dbname; String user="root"; String password="1234"; Connection conn=DriverManager.getConnection(url, user, password); String sql1="select * from recycle"; PreparedStatement pst1=conn.prepareStatement(sql1); ResultSet rs=pst1.executeQuery(); PreparedStatement pst2=null; PreparedStatement pst3=null; int sum=0; while(rs.next()) { int id15=rs.getInt("id"); String name15=rs.getString("name"); String sex15=rs.getString("sex"); int tel15=rs.getInt("tel"); String sql2="insert into idcard(id,name,sex,tel) values(?,?,?,?)"; pst2=conn.prepareStatement(sql2); pst2.setInt(1, id15); pst2.setString(2, name15); pst2.setString(3, sex15); pst2.setInt(4, tel15); String sql3="delete from recycle where id=?"; pst3=conn.prepareStatement(sql3); pst3.setInt(1, id15); pst3.execute(); pst2.executeUpdate(); sum++; } if(true) { out.println("已全部还原"+sum+"条记录!"); } if(pst3!=null) pst3.close(); if(pst2!=null) pst2.close(); if(conn!=null) conn.close(); if(rs!=null) rs.close(); if(pst1!=null) pst1.close(); response.setHeader("refresh", "2;url=recycle01.jsp"); %>
8.功能主页面:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
功能显示页面 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
页面菜单 操作页面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
操作显示页面 Hello,world!
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
主标题页面 名片管理系统
以上就是全部代码,可以点个免费的赞支持下吗!!!