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);
    	}
    	
    
    }
    

  • 相关阅读:
    java8 Stream排序字段为空排序方法
    SpringBoot使用token简单鉴权的具体实现方法
    性能调优
    TestNG最简单的测试
    TestNG异常测试
    TestNG中如何执行测试
    TestNG的基本注解
    TestNG介绍
    TestNG 环境搭建
    python第四课笔记
  • 原文地址:https://www.cnblogs.com/a1111/p/12816451.html
Copyright © 2011-2022 走看看