Commit 682a621e authored by mchaudhari's avatar mchaudhari

BOM Post save Update System details


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94576 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 37267b57
package ibase.webitm.ejb.mfg;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.w3c.dom.Document;
@javax.ejb.Stateless
public class BomPostSave extends ValidatorEJB implements BomPostSaveLocal,BomPostSaveRemote
{
public String postSave(String xmlString,String tranId,String editFlag, String xtraParams,Connection conn) throws RemoteException,ITMException
{
System.out.println("------------ postSave method called-----------------tranId : "+ tranId);
Document dom = null;
String errString="";
try
{
if (xmlString != null && xmlString.trim().length() > 0)
{
dom = parseString(xmlString);
errString = postSave(dom,tranId,editFlag,xtraParams,conn);
}
}
catch(Exception e)
{
System.out.println("Exception : BomPostSave : postSave : ==>\n"+e.getMessage());
throw new ITMException(e);
}
return errString;
}
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn)
{
System.out.println("post save dom data ---------------:"+dom);
String loginSiteCode="", chgTerm = "", chgUser = "", sql = "", error = "";
int cnt1 = 0;
GenericUtility genericUtility = GenericUtility.getInstance();
PreparedStatement pstmt = null,pstmt1=null;
ResultSet rs=null;
try
{
loginSiteCode=GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
tranId=genericUtility.getColumnValue("bom_code",dom);
chgTerm = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "chg_term");
chgUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "chg_user");
sql = "update bom set chg_date = sysdate, chg_term = ?, chg_user = ? where bom_code = ?";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, chgTerm);
pstmt1.setString(2, chgUser);
pstmt1.setString(3, tranId);
cnt1 = pstmt1.executeUpdate();
System.out.println(">>>>>>>successfully updated record bom post save cnt1:" + cnt1);
pstmt1.close();
pstmt1 = null;
}catch(Exception e)
{
try {
System.out.println(">>>>>>>>>>>>In catch Before rollback>>>");
conn.rollback();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
error=e1.getMessage();
}
System.out.println("Exception ::"+e);
e.printStackTrace();
error=e.getMessage();
}
finally
{
try {
System.out.println(">>>>>>>>>>>>In finally Before Commit>>>");
conn.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
error=e.getMessage();
}
}
return error;
}
}
package ibase.webitm.ejb.mfg;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
import org.w3c.dom.Document;
@Local // added for ejb3
public interface BomPostSaveLocal extends ValidatorLocal//, EJBObject
{
public String postSave(String xmlString,String tranId,String editFlag, String xtraParams,Connection conn) throws RemoteException,ITMException;
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn);
}
\ No newline at end of file
package ibase.webitm.ejb.mfg;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
//import javax.ejb.EJBObject;
import java.sql.Connection;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
import org.w3c.dom.Document;
@Remote // added for ejb3
public interface BomPostSaveRemote extends ValidatorRemote//, EJBObject
{
public String postSave(String xmlString,String tranId,String editFlag, String xtraParams,Connection conn) throws RemoteException,ITMException;
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn);
}
\ 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