Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package gosi.common.batch.util;
- import java.util.HashMap;
- /**
- * @CLASS NAME : BatchAuditBean
- * @TYPE :
- * @AUTHOR :
- * @VERSION : 1
- * @EXTENDS : Nil
- * @INFORMATION : This bean is used to store batch audit details
- * @IMPLEMENTS :
- * @LAST MODIFIED BY :
- * @LAST MODIFIED DATE :
- **/
- public class GOSIBatchSQL
- {
- private static String appModuleName;
- private static String appBatchIdentifier;
- public GOSIBatchSQL(String batchId)
- {
- appModuleName=batchId.substring(0,3);
- appBatchIdentifier=batchId.substring(4,7);
- commonSQL=GOSIBatchUtilities.
- populateSQL(GOSIBatchConstants.COMMON, null);
- interfaceSQL=GOSIBatchUtilities.
- populateSQL(GOSIBatchConstants.INTERFACE, null);
- moduleSQL=GOSIBatchUtilities.
- populateSQL(appModuleName, appBatchIdentifier);
- }
- public static String sqlFileName = null;
- public static HashMap commonSQL=null;
- public static HashMap moduleSQL=null;
- public static HashMap interfaceSQL=null;
- /**
- * @METHOD NAME : getSqlString
- * @INFORMATION : This method is to populate all SQL Strings
- * in HashMap module-wise.
- * @PARAM : sqlCode
- * @RETURN : class java.lang.String
- * @EXCEPTION : class gosi.common.batch.util.GOSIBatchException
- * @LAST MODIFIED BY :
- * @LAST MODIFIED DATE :
- **/
- public static String getSqlString(String sqlCode)
- throws GOSIBatchException
- {
- String sqlString = "";
- String moduleName = "";
- if(sqlCode != null)
- {
- moduleName = sqlCode.substring(0,3);
- }
- try
- {
- if((GOSIBatchConstants.COMMON).equals(moduleName))
- {
- sqlString = (String)GOSIBatchSQL.commonSQL.get(sqlCode);
- }
- else if((GOSIBatchConstants.INTERFACE).equals(moduleName))
- {
- sqlString = (String)GOSIBatchSQL.interfaceSQL.get(sqlCode);
- }
- else
- {
- sqlString = (String)GOSIBatchSQL.moduleSQL.get(sqlCode);
- }
- }// end of try
- catch(Exception e)
- {
- e.printStackTrace();
- new GOSIBatchException(e,
- "BatchCore",
- "GOSIBatchSQL",
- "getSqlString",
- "CMN_001_ERR_1000",
- GOSIBatchConstants.SEVERITY_ONE);
- }// end of catch
- return sqlString;
- }// end of method getsqlString
- }
Add Comment
Please, Sign In to add comment