zoukankan      html  css  js  c++  java
  • 银行营业网点管理系统——Servlet包(updateServlet )

    package BranchesMgr.servlet;
    
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.List;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import BranchesMgr.dao.BranchesDao;
    import BranchesMgr.dao.CityAreaDao;
    import BranchesMgr.dao.impl.BranchesDaoImpl;
    import BranchesMgr.dao.impl.CityAreaDaoImpl;
    import BranchesMgr.entity.Branches;
    import BranchesMgr.entity.CityArea;
    
    public class updateServlet extends HttpServlet {
    
    	
    	public void doGet(HttpServletRequest request, HttpServletResponse response)
    			throws ServletException, IOException {
    		PrintWriter out = response.getWriter();
    			String name=request.getParameter("name");
    			int cityid=Integer.parseInt(request.getParameter("city")); 
    			String address=request.getParameter("address");
    			String telephone=request.getParameter("telephone");
    			Branches breach=new Branches();
    			breach.setName(name);
    			breach.setCityAreatyid(cityid);
    			breach.setAddress(address);
    			breach.setTelephone(telephone);
    			BranchesDao breadao=new BranchesDaoImpl();
    			int rel=breadao.UpdateBranches(breach);
    			if(rel>0){
    				out.print("<script>alert('修改成功!');location.href='BrancheseServlet';</script>");
    			}else{
    				out.print("<script>alert('修改失败!');location.href='BrancheseServlet';</script>");
    			}
    	}
    
    
    	public void doPost(HttpServletRequest request, HttpServletResponse response)
    			throws ServletException, IOException {
    
    		doGet(request, response);
    	}
    	
    
    }
    

  • 相关阅读:
    JAVA 单例模式
    CodeForces Round #563 Div.2
    拓扑排序 JAVA
    初识 Dubbo
    CodeForces Round #567 Div.2
    Educational Codeforces Round 65 (Rated for Div. 2)
    最短路径问题
    C++使用fixed和precision控制小数和有效位数的输出以及setw()设置输出宽度
    poj3684(弹性碰撞模型)
    集合的整数表示
  • 原文地址:https://www.cnblogs.com/a1111/p/12816451.html
Copyright © 2011-2022 走看看