📄 rili_nmqhaction.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 java.util.Vector;import javabean.PubDate;import javabean.YLHQ_nmqh;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.Rili_nmqhForm;/** * Ylhq_nmqhAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 10-23-2004 * * XDoclet definition: * @struts:action path="/ylhq_nmqh" name="ylhq_nmqhForm" input="/form/ylhq_nmqh.jsp" validate="true" * @struts:action-forward name="/YLHQ_nmqhD.jsp" path="/YLHQ_nmqhD.jsp" */public class Rili_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 { Rili_nmqhForm ylhq_nmqhForm = (Rili_nmqhForm) form; String names=ylhq_nmqhForm.getnames().trim(); names=new String(names.getBytes("ISO-8859-1")); String sql; String times=ylhq_nmqhForm.getDates(); int number=0; ResultSet rs; dbconnect db=new dbconnect(); Vector vector1=new Vector(); PubDate pub=new PubDate(); String times1=pub.getshortPubdate(); sql="select max(pubdate) from ylhq1_nmqh"; rs=db.executeQuery(sql); if(rs.next()) { times1=rs.getString(1);//最大天 } rs.close(); if(times.compareTo(times1)>0) { sql="select * from ylhq1_nmqh where pubdate='"+times1+"' order by pubdate desc"; rs=db.executeQuery(sql); while(rs.next()) { YLHQ_nmqh nmqh=new YLHQ_nmqh(); nmqh.setsjcjl(rs.getInt("sjcjl")); nmqh.setyjcjl(rs.getInt("yjcjl")); nmqh.setdqcjl(rs.getInt("dqcjl")); nmqh.setprice_e(rs.getFloat("price_e")); nmqh.setprice_l(rs.getFloat("price_l")); nmqh.setprice_h(rs.getFloat("price_h")); nmqh.setprice_f(rs.getFloat("price_f")); nmqh.setzd(rs.getInt("zd")); nmqh.setpubdate(rs.getString("pubdate")); nmqh.setqhdate(rs.getString("qhdate")); vector1.add(nmqh); } rs.close(); request.setAttribute("vector1",vector1); request.setAttribute("names",names); request.setAttribute("times",times1); } else { sql="select * from ylhq1_nmqh where pubdate='"+times+"' order by pubdate desc"; rs=db.executeQuery(sql); while(rs.next()) { YLHQ_nmqh nmqh=new YLHQ_nmqh(); nmqh.setsjcjl(rs.getInt("sjcjl")); nmqh.setyjcjl(rs.getInt("yjcjl")); nmqh.setdqcjl(rs.getInt("dqcjl")); nmqh.setprice_e(rs.getFloat("price_e")); nmqh.setprice_l(rs.getFloat("price_l")); nmqh.setprice_h(rs.getFloat("price_h")); nmqh.setprice_f(rs.getFloat("price_f")); nmqh.setzd(rs.getInt("zd")); nmqh.setpubdate(rs.getString("pubdate")); nmqh.setqhdate(rs.getString("qhdate")); vector1.add(nmqh); number++; } rs.close(); if(number>0) { request.setAttribute("vector1",vector1); request.setAttribute("names",names); request.setAttribute("times",times); } else { sql="select * from ylhq1_nmqh where pubdate='"+times1+"' order by pubdate desc"; rs=db.executeQuery(sql); while(rs.next()) { YLHQ_nmqh nmqh=new YLHQ_nmqh(); nmqh.setsjcjl(rs.getInt("sjcjl")); nmqh.setyjcjl(rs.getInt("yjcjl")); nmqh.setdqcjl(rs.getInt("dqcjl")); nmqh.setprice_e(rs.getFloat("price_e")); nmqh.setprice_l(rs.getFloat("price_l")); nmqh.setprice_h(rs.getFloat("price_h")); nmqh.setprice_f(rs.getFloat("price_f")); nmqh.setzd(rs.getInt("zd")); nmqh.setpubdate(rs.getString("pubdate")); nmqh.setqhdate(rs.getString("qhdate")); vector1.add(nmqh); } rs.close(); request.setAttribute("vector1",vector1); request.setAttribute("names",names); request.setAttribute("times",times1); } } return mapping.findForward("Success"); //throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -