package CoreFS.SD03;
import java.sql.CallableStatement;
import java.sql.SQLException;

import CoreFS.SA01.CoreIComponent;
import CoreFS.SA06.CoreReturnObject;




public class CoreDBLog extends CoreIComponent
{
	
	public  void log2DB (String V_PGM_ID, String V_TABLE_ID, String V_TABLE_MODE, String V_ERR_DESC, String V_OPR_DESC)
	{
		//CallableStatement cStmt = getDao("mesdao").getCallableStatement("{call GP_ERROR(?, ?, ?, ?, ?, ?, ?, ?)}");
		CallableStatement cStmt = null ;
		cStmt = getDao("mesdao").getCallableStatement("{call GP_LOGERROR2DB(?, ?, ?, ?, ?, ?, ?, ?)}");

		try 
		{
	         cStmt.setString(1, V_PGM_ID);
	         cStmt.setString(2, V_TABLE_ID);
	         cStmt.setString(3, V_TABLE_MODE);
	         cStmt.setString(4, V_ERR_DESC);
	         cStmt.setString(5, V_OPR_DESC);
	         cStmt.setString(6, "");
	         cStmt.setString(7, "");
	         cStmt.registerOutParameter(8, java.sql.Types.VARCHAR);
	         
	         cStmt.execute();
	         	         
	     } catch (Exception ex) 
	     
	     {
	    	 logAdapter.filelogger.logFatal(V_ERR_DESC + " GP_ERROR PROCESS ERROR", ex);
	         
	     } finally
	     
	     {
	    	 if (cStmt != null)
	    	 {
	    		 try
	    		 {
	    			 cStmt.close();
	    		 }
	    		 catch (SQLException ex)
	    		 {
	    			 logAdapter.filelogger.logWarn(ex.getMessage(), ex);
	    		 }
	    	 }
	     }		 
	}
	

	

}