📄 backylhq_zsaction.java
字号:
// 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_zsForm;/** * Backylhq_zsAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 10-22-2004 * * XDoclet definition: * @struts:action path="/backylhq_zs" name="backylhq_zsForm" input="/form/backylhq_zs.jsp" validate="true" * @struts:action-forward name="/BackYLHQ_zs.jsp" path="/BackYLHQ_zs.jsp" */public class Backylhq_zsAction 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_zsForm backylhq_zsForm = (Backylhq_zsForm) form; String sql; dbconnect db=new dbconnect(); ResultSet rs; int zd1=backylhq_zsForm.getzd1(); int index1=backylhq_zsForm.getindex1(); int zd2=backylhq_zsForm.getzd1(); int index2=backylhq_zsForm.getindex1(); int zd3=backylhq_zsForm.getzd1(); int index3=backylhq_zsForm.getindex1(); String types1="棉价指数328"; String types2="棉价指数529"; String types3="棉价指数227"; PubDate pub=new PubDate(); int id=0; String pubdate=pub.getshortPubdate(); sql="select * from ylhq1_zmzs where pubdate='"+pubdate+"' and types1='"+types1+"' and types2='"+types2+"' and types3='"+types3+"'"; rs=db.executeQuery(sql); if(rs.next()) { return(new ActionForward(mapping.getInput())); } else { sql="select count(id) from ylhq1_zmzs"; rs=db.executeQuery(sql); if(rs.next()) { id=rs.getInt(1); } rs.close(); sql="insert into ylhq1_zmzs values('"+(id+1)+"','"+types1+"','"+index1+"','"+zd1+"','"+types2+"','"+index2+"','"+zd2+"','"+types3+"','"+index3+"','"+zd3+"','"+pubdate+"')"; rs=db.executeQuery(sql); rs.close(); } return mapping.findForward("BackSuccess"); //throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -