backylhq_nmqhaction.java

来自「这个程序是花了好几十万请人开发的」· Java 代码 · 共 96 行

JAVA
96
字号
// Created by Xslt generator for Eclipse.// XSL :  not found (java.io.FileNotFoundException:  (Bad file descriptor))// Default XSL used : easystruts.jar$org.easystruts.xslgen.JavaClass.xslpackage struts.action;import java.sql.ResultSet;import javabean.PubDate;import javabean.dbconnect;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 struts.form.Backylhq_nmqhForm;/**  * Backylhq_nmqhAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 10-22-2004 *  * XDoclet definition: * @struts:action path="/backylhq_nmqh" name="backylhq_nmqhForm" input="/form/backylhq_nmqh.jsp" validate="true" * @struts:action-forward name="/BackYLHQ_nmqh.jsp" path="/BackYLHQ_nmqh.jsp" */public class Backylhq_nmqhAction extends Action {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods	/** 	 * Method execute	 * @param ActionMapping mapping	 * @param ActionForm form	 * @param HttpServletRequest request	 * @param HttpServletResponse response	 * @return ActionForward	 * @throws Exception	 */	public ActionForward execute(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws Exception {		Backylhq_nmqhForm backylhq_nmqhForm = (Backylhq_nmqhForm) form;						String sql;		dbconnect db=new dbconnect();		ResultSet rs;		float zd=backylhq_nmqhForm.getzd();		int sjcjl=backylhq_nmqhForm.getsjcjl();		int dqcjl=backylhq_nmqhForm.getdqcjl();		int yjcjl=backylhq_nmqhForm.getyjcjl();		float price_e=backylhq_nmqhForm.getprice_e();		float price_h=backylhq_nmqhForm.getprice_h();		float price_l=backylhq_nmqhForm.getprice_l();		float price_f=backylhq_nmqhForm.getprice_f();		String year=backylhq_nmqhForm.getyear();		String month=backylhq_nmqhForm.getmonth();		String qhdate=year+"-"+month;		PubDate pub=new PubDate();		int id=0;		String pubdate=pub.getshortPubdate();				sql="select * from ylhq1_nmqh where pubdate='"+pubdate+"' and qhdate='"+qhdate+"'";		rs=db.executeQuery(sql);		if(rs.next())		{			return(new ActionForward(mapping.getInput()));		}		else		{			sql="select count(id) from ylhq1_nmqh";			rs=db.executeQuery(sql);			if(rs.next())			{				id=rs.getInt(1);			}			rs.close();					sql="insert into ylhq1_nmqh values('"+(id+1)+"','"+qhdate+"','"+price_f+"','"+price_h+"','"+price_l+"','"+price_e+"','"+zd+"','"+dqcjl+"','"+yjcjl+"','"+sjcjl+"','"+pubdate+"')";			rs=db.executeQuery(sql);			rs.close();		}		request.setAttribute("year",year);		request.setAttribute("month",month);		return mapping.findForward("BackSuccess");			//throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented.");	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?