【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“adddocumentkindAction.java”一文,供大家参考学习!
package com.stsc.archive.volumn;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import java.util.Properties;
import com.stsc.archive.file.Constants;
import org.apache.struts.util.MessageResources;
import com.stsc.util.STPoolDataSet;
import com.stsc.util.STResultSet;
public final class adddocumentkindAction extends Action
{
public String Iso2Gb(String str)
{
String ret=(str==null) ? "" : str;
try
{
byte[] byteStr=str.getBytes("ISO-8859-1");
return new String(byteStr,"gb2312");
}
catch(Exception e)
{
return ret;
}
}
public ActionForward perform(ActionMapping mapping,ActionForm form,
HttpServletRequest req,HttpServletResponse res)
{
String filetypename=req.getParameter("archivetype");
String documenttypename = req.getParameter("filetype");
//System.out.println(filetypename);
//System.out.println(documenttypename);
Properties dbBase = new Properties();
dbBase.setProperty("dsJndiName", Constants.ARCHIVE_DBSOURCE_KEY);
//System.out.println("dsfasdaa23233================"+filetypename);
STPoolDataSet data= new STPoolDataSet();
//String sql="INSERT INTO fArchiveType(ArchiveType) VALUES ('" + Iso2Gb(filetypename) +"')";
String
sql="INSERT INTO fFileType(ArchiveType,FileType) VALUES ('"+ filetypename +"','"+ documenttypename +"')";
data.executeSQL(sql,dbBase);
//System.out.println("adddocumentkindAction.java 123");
return mapping.findForward("success");
}
}