⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addguestbookaction.java

📁 用于进行书写定单的源代码.请各位一定要好好研究
💻 JAVA
字号:
package com.enlen.book;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.uniland.common.CallService;
import com.uniland.dao.Dao;
import com.uniland.dao.DaoParam;
import com.uniland.dao.RowSet;
import com.uniland.knowledge.AddLogForm;
import com.uniland.dao.*;
import com.uniland.util.*;

public class AddGuestBookAction extends Action {

	/**
	* Constructor
	*/
	public AddGuestBookAction() {

		super();

	}
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
		ActionErrors errors = new ActionErrors();
		ActionForward forward = new ActionForward();
		// return value

		try {
			//RowSet rs = ((AddLogForm) form).getRowSet();
			//Sequence seq=new Sequence();
		 
			DaoParam sver=new DaoParam();
			String strSql = "";
           String title = request.getParameter("title");
           String text = request.getParameter("text");
           String time = request.getParameter("time");
           String oper = request.getParameter("oper");
           String other = request.getParameter("other");
           text =new String (text.getBytes("iso-8859-1"),"gb2312");
           title =new String (title.getBytes("iso-8859-1"),"gb2312");
           String id=CallService.addSequence("B_ID");
            strSql = "INSERT INTO guestbook values('"+id+"','"+title+"','"+text+"',to_date('"+time+"','yyyy/mm/dd hh24:mi:ss'),'"+oper+"','"+other+"')";
            
              CallService.getDao().runSQL(strSql);
		}catch(Exception e)
		{
			e.getStackTrace();
		}
		return mapping.findForward("success");
        }
}

⌨️ 快捷键说明

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