基于java的实验室管理系统_javaweb管理系统项目

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

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

 项目编号:BS-XX-013

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

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

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

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

用户登陆:

基于java的实验室管理系统_javaweb管理系统项目

登陆后主界面:

基于java的实验室管理系统_javaweb管理系统项目

系统用户管理:

基于java的实验室管理系统_javaweb管理系统项目

用户信息管理:

基于java的实验室管理系统_javaweb管理系统项目

设备信息管理:

基于java的实验室管理系统_javaweb管理系统项目

设备借出管理:

基于java的实验室管理系统_javaweb管理系统项目

设备维修管理:

基于java的实验室管理系统_javaweb管理系统项目

共建记录管理:

基于java的实验室管理系统_javaweb管理系统项目

实验室设备统计:

基于java的实验室管理系统_javaweb管理系统项目

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

核心代码:

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
	}

}

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
	}

}

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/183811.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 光猫不改桥接外网能访问吗_光猫桥接的利弊

    光猫不改桥接外网能访问吗_光猫桥接的利弊因为群晖需要外网访问,将自购的路由器改为拨号上网,光猫设置为桥接模式。但这种情况下,因为路由的网段(我的是192.168.3.x)和光猫的网段(电信,默认192.168.1.x)不同,此时不能通过192.168.1.1网址来连接光猫,网上也有将光猫称作副路由。解决方法:1、在光猫中插入一根网线,通过有线的方式连接到电脑。现在的笔记本很多都不带RJ45网口,还需要另外准备转接头和网线。2、临时将路由的上网方式变更为自动获取,然后就可以连接192.168.1.1。这种方法的缺点是

  • 群晖3617可以有几个网卡_解决黑群辉使用的几个问题

    群晖3617可以有几个网卡_解决黑群辉使用的几个问题本文帮助黑群辉刚上手的人,默认已经安装好黑群辉系统了哦。如果系统也还没有安装,那就要根据自己现有手上的设备搜索相应的安装教程了。相应文章很多,情况也不同,就不在这里说明了。一、启用视频缩略图和转码一般使用群辉的人肯定要用它来保存自己的照片和视频,所以这个功能一定要开启的。否则VS和photo中各种感叹号图。倒是不影响播放,但是预览和美观就很不方便了。目前最完美的解决方案是半洗白,可以开启视频缩略图…

  • 数据库课程设计:教务管理系统Swing+MySql

    数据库课程设计:教务管理系统Swing+MySql文章目录实验报告主要内容3.2需求分析3.2.1简要叙述系统需求调查的方法1.需求分析的调查方法和流程2,需求调查结果的整理各种图1.业务流程图2.数据流图3.数据字典(截取部分)4.功能模块图5.用例图6.概念设计的基本思想和原理方法7.物理模型界面下载链接实验报告主要内容3.2需求分析3.2.1简要叙述系统需求调查的方法1.需求分析的调查方法和流程①调查学校教务系统的组织结构,列出各…

  • asp.net专业实习——网上花店系统

    asp.net专业实习——网上花店系统2019.5.2项目适用vs2010直接打开后更改数据库连接字符串即可如果在添加商品遇到报错,多半是输入的字符太多了链接:https://pan.baidu.com/s/1ulU89ogdHKRVGv9ad5Zszw提取码:he88复制这段内容后打开百度网盘手机App,操作更方便哦此项目是用vs2013开发,使用时需要重新配置连接字符串。。如果你的环境是vs20…

  • flot中文详解

    flot中文详解

  • 精进Quartz—Spring和Quartz集成详解(三)「建议收藏」

    Spring是一个很优秀的框架,它无缝的集成了Quartz,简单方便的让企业级应用更好的使用Quartz进行任务的调度。下面就对Spring集成Quartz进行简单的介绍和示例讲解!和上一节 Quartz学习——2、简单入门示例Demo 的流程相似,介绍Spring和Quartz集成存储方式使用的是RAM方式和JDBC方式! 注:在企业级开发过程中,正常情况下不会使用RAM方式进行任务的存储,都

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号