📄 riliaction.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.YLHQ1;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.RiliForm;/** * RiliAction.java created by EasyStruts - XsltGen. * http://easystruts.sf.net * created on 10-17-2004 * * XDoclet definition: * @struts:action path="/rili" name="riliForm" input="/rili.jsp" validate="true" * @struts:action-forward name="/hp.jsp" path="/hp.jsp" */public class RiliAction 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 { RiliForm riliForm = (RiliForm) form; String names=riliForm.getnames().trim(); names=new String(names.getBytes("ISO-8859-1")); String sql; String times=riliForm.getDates(); ResultSet rs; dbconnect db=new dbconnect(); Vector vector1=new Vector(); PubDate pub=new PubDate(); String times1=pub.getshortPubdate(); if(times.compareTo(times1)>0) { sql="select times,types,areas,market,prices,danw from ylhq1 where names='"+names+"' and times='"+times1+"'"; rs=db.executeQuery(sql); while(rs.next()) { YLHQ1 ylhq1=new YLHQ1(); ylhq1.settimes(rs.getString("times")); ylhq1.setareas(rs.getString("areas")); ylhq1.setmarket(rs.getString("market")); ylhq1.settypes(rs.getString("types")); ylhq1.setprices(rs.getInt("prices")); ylhq1.setdanw(rs.getString("danw")); vector1.add(ylhq1); } rs.close(); request.setAttribute("vector1",vector1); request.setAttribute("names",names); request.setAttribute("times",times1); } else { sql="select times,types,areas,market,prices,danw from ylhq1 where names='"+names+"' and times='"+times+"'"; rs=db.executeQuery(sql); while(rs.next()) { YLHQ1 ylhq1=new YLHQ1(); ylhq1.settimes(rs.getString("times")); ylhq1.setareas(rs.getString("areas")); ylhq1.setmarket(rs.getString("market")); ylhq1.settypes(rs.getString("types")); ylhq1.setprices(rs.getInt("prices")); ylhq1.setdanw(rs.getString("danw")); vector1.add(ylhq1); } rs.close(); request.setAttribute("vector1",vector1); request.setAttribute("names",names); request.setAttribute("times",times); } return mapping.findForward("Success"); //throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented."); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -