Commit d5028cf0 authored by manohar's avatar manohar

This commit was generated by cvs2svn to compensate for changes in r452,

which included commits to RCS files with non-trunk default branches.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91517 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3d302e1d
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ibase.webitm.ejb.sys;
import java.rmi.RemoteException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.w3c.dom.*;
import ibase.system.config.ConnDriver;
import ibase.utility.GenericUtility;
import ibase.webitm.ejb.*;
import java.sql.*;
import ibase.webitm.utility.ITMException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import javax.ejb.Stateless;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import ibase.system.config.AppConnectParm;
import javax.naming.InitialContext;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.rpc.ParameterMode;
import ibase.utility.UserInfoBean;
/**
*
* @author msharma
*/
@Stateless
public class LoadBatch extends ActionHandlerEJB implements LoadBatchLocal,LoadBatchRemote
{
public String actionHandler(String tranId, String xtraParams, String forcedFlag) throws RemoteException, ITMException
{
String errString=null;
Connection conn=null;
ConnDriver ConnDriver = new ConnDriver();
PreparedStatement pstmt=null,pstmt1=null;
ResultSet rs=null;
String loadStat="";
System.out.println("tranId----"+tranId);
try
{
conn = ConnDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
System.out.println("xtraParams----"+xtraParams);
System.out.println("forcedFlag----"+forcedFlag);
tranId=tranId.substring(0,tranId.indexOf(":"));
tranId=tranId.trim();
if(tranId!=null || tranId.trim().length()>0)
{
pstmt=conn.prepareStatement("select load_stat from batchload where batch_id=?");
pstmt.setString(1,tranId);
rs=pstmt.executeQuery();
if(rs.next())
{
loadStat=rs.getString(1);
}
if(rs!=null)
{
rs.close();
rs=null;
}
if(pstmt!=null)
{
pstmt.close();
pstmt=null;
}
if(loadStat.equalsIgnoreCase("N"))
{
errString=AppBatch(tranId,xtraParams,forcedFlag);
}
else
{
System.out.println("Batch Load:errCode:"+"VTLOBATCH");
errString = itmDBAccess.getErrorString("","VTLOBATCH","");
System.out.println("errString:"+errString+":");
}
}
}catch(Exception e)
{
e.printStackTrace();
}
finally
{
if(conn!=null)
{
try {
conn.close();
conn = null;
} catch (SQLException ex)
{
ex.printStackTrace();
}
}
}
return errString;
}
String AppBatch(String tranId,String xtraParams,String forcedFlag)
{
String errString="";
UserInfoBean userInfo=null;
MasterApplyEJBLocal masterAppLocal=null;
try
{
masterAppLocal =getComponent("MasterApplyEJB");
userInfo=new UserInfoBean();
masterAppLocal.applyMasterTable(tranId,xtraParams,userInfo);
}catch(Exception e)
{
e.printStackTrace();
}
return errString;
}
private MasterApplyEJBLocal getComponent( String EjbComponent) throws ITMException
{
InitialContext ctx = null;
MasterApplyEJBLocal masterAppLocal = null; // for ejb3
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext(appConnect.getProperty());
System.out.println("************InitialContext ctx = *******************************************");
masterAppLocal = (MasterApplyEJBLocal)ctx.lookup("ibase/" +EjbComponent +"/local");
System.out.println("************ masterAppLocal = *******************************************");
}
catch(ITMException itme)
{
System.out.println("ITMException :EjbComponent : getComponent :==>");
throw itme;
}
catch(Exception e)
{
System.out.println("Exception :getComponent : getComponent :==>");
throw new ITMException(e);
}
return masterAppLocal;
}
}
\ No newline at end of file
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ibase.webitm.ejb.sys;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
import javax.ejb.EJBException;
/**
*
* @author msharma
*/
@Local
public interface LoadBatchLocal {
public abstract String actionHandler(String tranId, String xtraParams, String forcedFlag)
throws RemoteException, ITMException;
}
\ No newline at end of file
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ibase.webitm.ejb.sys;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
import javax.ejb.EJBException;
/**
*
* @author msharma
*/
@Remote
public interface LoadBatchRemote {
public String actionHandler(String tranId, String xtraParams, String forcedFlag)
throws RemoteException, ITMException;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment