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

  • 相关阅读:
    maven配置成功,但显示'cmd' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
    java ee 4周
    java 3周
    XML
    web后台过程
    【转】Maven详细
    HDFS 客户端读写操作详情
    HDFS DataNode详解
    HDFS NameNode详解
    CSS的四种样式
  • 原文地址:https://www.cnblogs.com/a1111/p/12816450.html
Copyright © 2011-2022 走看看