基于Javaweb实现实验室设备管理系统

简介: 本项目基于JSP/Servlet技术实现开发,开发工具采用IDEA或ECLIPSE,数据库采用MYSQL数据库。首次使用,需要进入src/com/util/DBOK 修改数据库的相关信息,系统设置mysql的用户名为root,密码为root,可以根据需要修改为自己的账户信息。实验室设备管理系统主要包含两个用户角色,一个是超级管理员,可以进行系统的各种管理工作,一个是普通管理员,主要进入系统进行相应的信息查看工作。系统的主要功能包含有:登陆用户的信息修改,系统用户管理,使用设备的用户信息管理,实验设备管理,设备借出管理,设备维修管理,共建记录管理,实验室设备统计(图形报表的形式展示)

  项目编号:BS-XX-013

本项目基于JSP/Servlet技术实现开发,开发工具采用IDEA或ECLIPSE,数据库采用MYSQL数据库。

首次使用,需要进入src/com/util/DBOK 修改数据库的相关信息,系统设置mysql的用户名为root,密码为root,可以根据需要修改为自己的账户信息。

实验室设备管理系统主要包含两个用户角色,一个是超级管理员,可以进行系统的各种管理工作,一个是普通管理员,主要进入系统进行相应的信息查看工作。系统的主要功能包含有:登陆用户的信息修改,系统用户管理,使用设备的用户信息管理,实验设备管理,设备借出管理,设备维修管理,共建记录管理,实验室设备统计(图形报表的形式展示),注销退出,登陆系统。

下面就部分功能进行功能展示:

用户登陆:

image.gif编辑

登陆后主界面:

image.gif编辑

系统用户管理:

image.gif编辑

用户信息管理:

image.gif编辑

设备信息管理:

image.gif编辑

设备借出管理:

image.gif编辑

设备维修管理:

image.gif编辑

共建记录管理:

image.gif编辑

实验室设备统计:

image.gif编辑

以上是展示的系统部分功能,此项目功能完整,运行无误,比较适合毕业设计使用。

核心代码:

package com.action;
/**
 * 管理员登陆 增加 修改 删除  
 */
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
import java.util.StringTokenizer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bean.ComBean; 
import com.util.Constant;
import com.util.MD5;
public class AdminServlet extends HttpServlet {
  /**
   * Constructor of the object.
   */
  public AdminServlet() {
    super();
  }
  /**
   * Destruction of the servlet. <br>
   */
  public void destroy() {
    super.destroy(); // Just puts "destroy" string in log
    // Put your code here
  }
  /**
   * The doGet method of the servlet. <br>
   *
   * This method is called when a form has its tag value method equals to get.
   * 
   * @param request the request send by the client to the server
   * @param response the response send by the server to the client
   * @throws ServletException if an error occurred
   * @throws IOException if an error occurred
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    doPost(request,response);
  }
  /**
   * The doPost method of the servlet. <br>
   *
   * This method is called when a form has its tag value method equals to post.
   * 
   * @param request the request send by the client to the server
   * @param response the response send by the server to the client
   * @throws ServletException if an error occurred
   * @throws IOException if an error occurred
   */
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response.setContentType(Constant.CONTENTTYPE);
    request.setCharacterEncoding(Constant.CHARACTERENCODING);
    String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
    String date2=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
    try{
      String method=request.getParameter("method").trim();
      ComBean cBean = new ComBean();
      HttpSession session = request.getSession();   
      if(method.equals("one")){//用户登录
        String username = request.getParameter("username");
        String password = request.getParameter("password");  
        String sf = request.getParameter("sf");  
        String sql="select realname from admin where username='"+username+"' and  password='"+password+"'  and  sf='"+sf+"' ";
        String str=cBean.getString(sql);
        if(str==null){
          request.setAttribute("message", "登录信息错误!");
          request.getRequestDispatcher("index.jsp").forward(request, response); 
        }
        else{
          session.setAttribute("user", username); session.setAttribute("sf", sf); 
          request.getRequestDispatcher("admin/index.jsp").forward(request, response); 
        }  
      }
      else if(method.equals("uppwd")){//修改密码
        String username=(String)session.getAttribute("user"); 
        String oldpwd = request.getParameter("oldpwd"); 
        String newpwd = request.getParameter("newpwd"); 
        String str=cBean.getString("select id from admin where username='"+username+"' and  password='"+oldpwd+"'");
        if(str==null){
          request.setAttribute("message", "原始密码信息错误!");
          request.getRequestDispatcher("admin/system/editpwd.jsp").forward(request, response); 
        }
        else{
          int flag=cBean.comUp("update admin set password='"+newpwd+"' where username='"+username+"'");
          if(flag == Constant.SUCCESS){ 
            request.setAttribute("message", "操作成功!");
            request.getRequestDispatcher("admin/system/editpwd.jsp").forward(request, response); 
          }
          else { 
            request.setAttribute("message", "操作失败!");
            request.getRequestDispatcher("admin/system/editpwd.jsp").forward(request, response); 
          }
        }
      }
      else if(method.equals("adminexit")){//退出登录
        session.removeAttribute("user");  session.removeAttribute("sf");
        request.getRequestDispatcher("index.jsp").forward(request, response); 
      }
      else if(method.equals("addm")){//增加系统用户
        String username = request.getParameter("username"); 
        String password = request.getParameter("password"); 
        String realname = request.getParameter("realname"); 
        String sex = request.getParameter("sex"); 
        String age = request.getParameter("age"); 
        String address = request.getParameter("address"); 
        String tel = request.getParameter("tel"); 
        String str=cBean.getString("select id from admin where username='"+username+"'");
        if(str==null){ 
            int flag=cBean.comUp("insert into admin(username,password,realname,sex,age,address,tel,addtime ) " +
                "values('"+username+"','"+password+"','"+realname+"','"+sex+"','"+age+"','"+address+"','"+tel+"','"+date+"' )");
            if(flag == Constant.SUCCESS){ 
              request.setAttribute("message", "操作成功!");
              request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
            }
            else { 
              request.setAttribute("message", "操作失败!");
              request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
            } 
        }
        else{
          request.setAttribute("message", "该用户名已存在!");
          request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
        } 
      }
      else if(method.equals("upm")){//修改系统用户
        String id = request.getParameter("id");
        String password = request.getParameter("password");
        String realname = request.getParameter("realname"); 
        String sex = request.getParameter("sex"); 
        String age = request.getParameter("age"); 
        String address = request.getParameter("address"); 
        String tel = request.getParameter("tel");  
        int flag=cBean.comUp("update admin set password='"+password+"',realname='"+realname+"',sex='"+sex+"',age='"+age+"'," +
            "address='"+address+"',tel='"+tel+"' where id='"+id+"'");
        if(flag == Constant.SUCCESS){ 
          request.setAttribute("message", "操作成功!");
          request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
        }
        else { 
          request.setAttribute("message", "操作失败!");
          request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
        }
      }
      else if(method.equals("delm")){//删除系统用户
        String id = request.getParameter("id");  
        int flag=cBean.comUp("delete from admin where id='"+id+"'");
        if(flag == Constant.SUCCESS){ 
          request.setAttribute("message", "操作成功!");
          request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
        }
        else { 
          request.setAttribute("message", "操作失败!");
          request.getRequestDispatcher("admin/system/index.jsp").forward(request, response); 
        }
      } 
      else{//无参数传入转到错误页面
        request.getRequestDispatcher("error.jsp").forward(request, response);
      }
    }catch(Exception e){
      e.printStackTrace();
      request.getRequestDispatcher("error.jsp").forward(request, response);
    }
  }
  /**
   * Initialization of the servlet. <br>
   *
   * @throws ServletException if an error occure
   */
  public void init() throws ServletException {
    // Put your code here
  }
}

image.gif

package com.action;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bean.ComBean;
import com.util.Constant;
public class ComServlet extends HttpServlet {
  /**
   * Constructor of the object.
   */
  public ComServlet() {
    super();
  }
  /**
   * Destruction of the servlet. <br>
   */
  public void destroy() {
    super.destroy(); // Just puts "destroy" string in log
    // Put your code here
  }
  /**
   * The doGet method of the servlet. <br>
   *
   * This method is called when a form has its tag value method equals to get.
   * 
   * @param request the request send by the client to the server
   * @param response the response send by the server to the client
   * @throws ServletException if an error occurred
   * @throws IOException if an error occurred
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    doPost(request,response);
  }
  /**
   * The doPost method of the servlet. <br>
   *
   * This method is called when a form has its tag value method equals to post.
   * 
   * @param request the request send by the client to the server
   * @param response the response send by the server to the client
   * @throws ServletException if an error occurred
   * @throws IOException if an error occurred
   */
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response.setContentType(Constant.CONTENTTYPE);
    request.setCharacterEncoding(Constant.CHARACTERENCODING);
    HttpSession session = request.getSession();
    ComBean cBean = new ComBean();
    String date=new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime());
    String date2=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
    String method = request.getParameter("method");
    if(method.equals("addview1")){  
      //String xm="";String xb="";String nl="";String st="";String hj="";String sfz="";String lxr="";
      //String dh="";String zz="";String cw="";String hg="";String rz="";String cy="";
      String name = request.getParameter("name"); 
      String sex = request.getParameter("sex"); 
      String age = request.getParameter("age"); 
      String build = request.getParameter("build"); 
      int flag = cBean.comUp("insert into view1(name,sex,age,build) values('"+name+"','"+sex+"','"+age+"','"+build+"')");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("upview1")){ ////修改信息
      String id=request.getParameter("id");
      String name = request.getParameter("name"); 
      String sex= request.getParameter("sex"); 
      String age = request.getParameter("age"); 
      String build= request.getParameter("build"); 
      int flag = cBean.comUp("update view1 set name='"+name+"',sex='"+sex+"',age='"+age+"',build='"+build+"' where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delview1")){//删除信息
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from view1 where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "系统维护中,请稍后再试!");
        request.getRequestDispatcher("admin/view1/index.jsp").forward(request, response);
      }
    } 
    else if(method.equals("addview2")){    
      String lend1 = request.getParameter("lend1"); 
      String lend2= request.getParameter("lend2"); 
      String lend3 = request.getParameter("lend3");  
      String lend4 = request.getParameter("lend4"); 
      String lend5= request.getParameter("lend5"); 
      String lend6 = request.getParameter("lend6");  
      String lend7 = request.getParameter("lend7"); 
      String lend8 = request.getParameter("lend8"); 
      int flag = cBean.comUp("insert into view2(lend1,lend2,lend3,lend4,lend5,lend6,lend7,lend8) values('"+lend1+"','"+lend2+"','"+lend3+"','"+lend4+"','"+lend5+"','"+lend6+"','"+lend7+"','"+lend8+"')");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("upview2")){ 
      String id=request.getParameter("id");
      String lend1= request.getParameter("lend1"); 
      String lend2 = request.getParameter("lend2"); 
      String lend3 = request.getParameter("lend3"); 
      String lend4= request.getParameter("lend4"); 
      String lend5 = request.getParameter("lend5"); 
      String lend6 = request.getParameter("lend6"); 
      String lend7 = request.getParameter("lend7"); 
      String lend8 = request.getParameter("lend8"); 
      int flag = cBean.comUp("update view2 set lend1='"+lend1+"',lend2='"+lend2+"',lend3='"+lend3+"',lend4='"+lend4+"',lend5='"+lend5+"',lend6='"+lend6+"',lend7='"+lend7+"',lend8='"+lend8+"' where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delview2")){
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from view2 where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "系统维护中,请稍后再试!");
        request.getRequestDispatcher("admin/view2/index.jsp").forward(request, response);
      }
    } 
    else if(method.equals("addview3")){  
      String information = request.getParameter("information"); 
      String total = request.getParameter("total"); 
      String phone = request.getParameter("phone");  
      int flag = cBean.comUp("insert into view3(information,total,phone) values('"+information+"','"+total+"','"+phone+"' )");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("upview3")){ 
      String id=request.getParameter("id");
      String information = request.getParameter("information"); 
      String total = request.getParameter("total"); 
      String phone = request.getParameter("phone");      
      int flag = cBean.comUp("update view3 set information='"+information+"',total='"+total+"',phone='"+phone+"' where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delview3")){
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from view3 where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "系统维护中,请稍后再试!");
        request.getRequestDispatcher("admin/view3/index.jsp").forward(request, response);
      }
    }     
    else if(method.equals("addview4")){   
      String number = request.getParameter("number"); 
      String name= request.getParameter("name"); 
      String area = request.getParameter("area"); 
      String price = request.getParameter("price"); 
      String status = request.getParameter("status");  
      int flag = cBean.comUp("insert into view4(number,name,area,price,status) values('"+number+"','"+name+"','"+area+"','"+price+"','"+status+"')");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("upview4")){ 
      String id=request.getParameter("id");
      String number = request.getParameter("number"); 
      String name = request.getParameter("name"); 
      String area = request.getParameter("area"); 
      String price= request.getParameter("price"); 
      String status = request.getParameter("status"); 
      int flag = cBean.comUp("update view4 set number='"+number+"',name='"+name+"',area='"+area+"',price='"+price+"',status='"+status+"' where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delview4")){
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from view4 where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view4/index.jsp").forward(request, response);
      }
    } 
    else if(method.equals("addview5")){      
      String Repairnumber = request.getParameter("Repairnumber"); 
      String BuildName = request.getParameter("BuildName"); 
      String Repairdate = request.getParameter("Repairdate"); 
      String Repairtime = request.getParameter("Repairtime"); 
      String Repaircharge = request.getParameter("Repaircharge");  
      int flag = cBean.comUp("insert into view5(Repairnumber,BuildName,Repairdate,Repairtime,Repaircharge) values('"+Repairnumber+"','"+BuildName+"','"+Repairdate+"','"+Repairtime+"','"+Repaircharge+"')");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "系统维护中,请稍后再试!");
        request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("upview5")){ 
      String id=request.getParameter("id");
      String Repairnumber = request.getParameter("Repairnumber"); 
      String BuildName = request.getParameter("BuildName"); 
      String Repairdate = request.getParameter("Repairdate"); 
      String Repairtime= request.getParameter("Repairtime"); 
      String Repaircharge = request.getParameter("Repaircharge"); 
      int flag = cBean.comUp("update view5 set Repairnumber='"+Repairnumber+"',BuildName='"+BuildName+"',Repairdate='"+Repairdate+"',Repairtime='"+Repairtime+"',Repaircharge='"+Repaircharge+"' where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delview5")){
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from view5 where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/view5/index.jsp").forward(request, response);
      }
    } 
    else if(method.equals("addxz")){   
      String lr = request.getParameter("lr"); 
      String fy = request.getParameter("fy"); 
      String kc = request.getParameter("kc"); 
      String zt = request.getParameter("zt"); 
      String xx = request.getParameter("xx");  
      float sji=Float.parseFloat(fy)-Float.parseFloat(kc);
      int flag = cBean.comUp("insert into xz(lr,fy,kc,zt,xx,sji) values('"+lr+"','"+fy+"','"+kc+"','"+zt+"','"+xx+"','"+sji+"' )");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "系统维护中,请稍后再试!");
        request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("upxz")){ 
      String id=request.getParameter("id");
      String lr = request.getParameter("lr"); 
      String fy = request.getParameter("fy"); 
      String kc = request.getParameter("kc"); 
      String zt = request.getParameter("zt"); 
      String xx = request.getParameter("xx"); 
      float sji=Float.parseFloat(fy)-Float.parseFloat(kc);
      int flag = cBean.comUp("update xz set lr='"+lr+"',fy='"+fy+"',kc='"+kc+"',zt='"+zt+"',xx='"+xx+"',sji='"+sji+"'  where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delxz")){
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from xz where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/xz/index.jsp").forward(request, response);
      }
    } 
    else if(method.equals("addhgqj")){  
      String lr = request.getParameter("lr"); 
      String sj = request.getParameter("sj"); 
      String xx = request.getParameter("xx");  
      int flag = cBean.comUp("insert into hgqj(lr,sj,xx) values('"+lr+"','"+sj+"','"+xx+"' )");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
      } 
    } 
    else if(method.equals("uphgqj")){
      String id=request.getParameter("id");
      String lr = request.getParameter("lr"); 
      String sj = request.getParameter("sj"); 
      String xx = request.getParameter("xx");      
      int flag = cBean.comUp("update hgqj set lr='"+lr+"',sj='"+sj+"',xx='"+xx+"' where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
      }  
    } 
    else if(method.equals("delhgqj")){
      String id = request.getParameter("id"); 
      int flag = cBean.comUp("delete from hgqj where id='"+id+"'");
      if(flag == Constant.SUCCESS){ 
        request.setAttribute("message", "操作成功!");
        request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
      }
      else{
        request.setAttribute("message", "操作失败!");
        request.getRequestDispatcher("admin/hgqj/index.jsp").forward(request, response);
      }
    } 
  }
  /**
   * Initialization of the servlet. <br>
   *
   * @throws ServletException if an error occure
   */
  public void init() throws ServletException {
    // Put your code here
  }
}

image.gif


相关文章
|
6月前
|
前端开发 JavaScript Java
计算机Java项目|基于web的铁路订票管理系统
计算机Java项目|基于web的铁路订票管理系统
|
2月前
|
存储 监控 安全
PowerShell 语言与员工上网行为监控软件的系统管理协同
在现代企业的网络管理中,员工上网行为监控软件至关重要,PowerShell 以其强大的功能和灵活性,能有效协助监控软件的部署与管理。通过编写简单脚本,系统管理员可检查软件安装状态,自动化处理监控数据,甚至实现异常行为报警,显著提升企业网络安全和管理效率。
33 0
|
6月前
|
小程序 Java 数据库
计算机Java项目|基于微信小程序的健康早知道系统
计算机Java项目|基于微信小程序的健康早知道系统
|
6月前
|
前端开发 JavaScript Java
计算机Java项目|SSM疫情之下社区管理系统
计算机Java项目|SSM疫情之下社区管理系统
|
7月前
|
JavaScript Java 关系型数据库
小型医院医疗设备管理系统|基于springboot小型医院医疗设备管理系统设计与实现(源码+数据库+文档)
小型医院医疗设备管理系统|基于springboot小型医院医疗设备管理系统设计与实现(源码+数据库+文档)
55 0
|
7月前
|
运维 监控 Java
springboot基层医院综合HIS信息管理系统源码 医生工作站、护士工作站
病例质控:医生个人质控、病历控制、缺陷监控、质控设置、病历查询、统计分析
85 0
springboot基层医院综合HIS信息管理系统源码 医生工作站、护士工作站
|
7月前
|
人工智能 前端开发 JavaScript
计算机Java项目|springboot校园台球厅人员与设备管理系统(二)
计算机Java项目|springboot校园台球厅人员与设备管理系统
计算机Java项目|springboot校园台球厅人员与设备管理系统(二)
|
7月前
|
传感器 人工智能 监控
Java智慧工地管理云平台源码 带AI识别、桌面管理+大屏指挥+手机APP
智慧工地平台支持项目级、公司级、集团级多级权限划分,可根据企业的组织架构进行项目权限、功能权限、数据权限设定。
162 0
|
7月前
|
Java 关系型数据库 应用服务中间件
计算机Java项目|springboot校园台球厅人员与设备管理系统(一)
计算机Java项目|springboot校园台球厅人员与设备管理系统
107 0
|
7月前
|
前端开发 JavaScript Java
计算机Java项目|古诗词数字化平台
计算机Java项目|古诗词数字化平台