📄 office_showdetialsaction.java
字号:
/* * * @author 郑文金 * * 这个action显示会员的详细信息 * */package struts.action;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import javabean.*;import java.sql.*;public class Office_ShowdetialsAction extends Action { private ConnectionPool pool; private Connection con; public Office_ShowdetialsAction() throws SQLException { pool=ConnectionPool.getInstance(); //初始化连接池 } public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CodeString codestring=new CodeString(); String id=request.getParameter("code"); id=codestring.getString(id);//获取页面中的code 的值 con=pool.getConnection(); //从池中获得一个连接 Txlbdao txl=new Txlbdao(con); String str="select * from member where ID="+"'"+id+"'"; Member member=txl.showdetials(str); request.setAttribute("member",member); con.commit(); if(con!=null) { con.close(); } return mapping.findForward("office_showdetials"); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -