int xbid=1;
           int strtype=1;
           int xbobjectid=-1;
           String xbloginfo="'下载附件:"+fileTrueName+"'";
           new AddLog(strtype,xbid,xbobjectid,xbloginfo) ;package net.btdz.oa.common;
import net.btdz.oa.common.*;
import java.util.*;
import java.text.*;
import java.sql.*;
public class AddLog {
    public AddLog(int strtype,int xbid,int xbobjectid,String xbloginfo){
        
        String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
        Connection conn = null;
        Statement s= null;
        int rs;
        try{
        conn = ConnectionPoolBean.getConnection();
        String  sql="insert into oalogs(logtype,per_id,objectid,logtime,loginfo) values ("+strtype+","+xbid+","+xbobjectid+",'"+date+"','下载附件')";
        System.out.print(sql);
        s=conn.createStatement();
    rs=s.executeUpdate(sql);
        
        }
         catch(SQLException se){
            
        
    }
         finally
         {
            try{//关闭顺序 
               
         if(s!=null) s.close();
                if(conn!=null) conn.close();
         }catch(SQLException sqle){sqle.printStackTrace();}
         }
         }}