adddocumentkindaction.java

来自「一套完整的档案管理系统」· Java 代码 · 共 50 行

JAVA
50
字号
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");
       }
}
      	

⌨️ 快捷键说明

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