Commit 6cb7b55a authored by pgole's avatar pgole

Updated ejb for edi generation component[D16ESUN003]


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@103157 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 97238597
......@@ -11,20 +11,14 @@ import ibase.webitm.ejb.E12CreateBatchLoadEjb;
import ibase.webitm.utility.ITMException;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.sys.CreateRCPXML;
import ibase.webitm.ejb.sys_UTL.CommonFunctions;
import java.rmi.RemoteException;
import java.sql.*;
import org.w3c.dom.*;
@javax.ejb.Stateless
public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLocal, GenBatchPosSaveRemote
{
E12GenericUtility genericUtility = new E12GenericUtility();
ValidatorEJB validator = null;
CommonFunctions commonFunctions = new CommonFunctions();
ITMDBAccessEJB dbEjb = new ITMDBAccessEJB() ;
@Override
public String postSave() throws RemoteException, ITMException
{
......@@ -36,22 +30,23 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
public String postSave(String xmlStringAll, String tranId, String editFlag, String xtraParams, Connection conn) throws RemoteException, ITMException
{
System.out.println("PostSave Action Called:::");
E12GenericUtility genericUtility = new E12GenericUtility();
ITMDBAccessEJB dbEjb = new ITMDBAccessEJB() ;
Document dom = null;
PreparedStatement pstmt = null;
ResultSet rs = null ;
boolean isError = false ;
String sql = "", ediOption = "" ,winName = "" ,dataStr = "" ,retString = "",tranIdCol = "";
String sql = "", ediOption = "" , winName = "" ,dataStr = "" ,retString = "",tranIdCol = "";
try
{
E12GenericUtility genericUtility = new E12GenericUtility();
dom = genericUtility.parseString(xmlStringAll);
/*System.out.println("dom>>"+dom);
System.out.println("xmlStringAll>>"+xmlStringAll);
System.out.println(" Tran id = "+tranId);
System.out.println("xtraParams:::" +xtraParams);
*/
System.out.println("xtraParams:::" +xtraParams);*/
NodeList parentNodeList1 = dom.getElementsByTagName("Detail1");
Node parentNode1 = parentNodeList1.item(0);
......@@ -59,18 +54,23 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
System.out.println("winName in posSave"+ winName);
sql = "select edi_option,tran_id_col from transetup where tran_window = ? ";
sql = "select edi_option,tran_id_col from transetup where tran_window= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, winName);
rs = pstmt.executeQuery();
if (rs.next())
{
ediOption = checkNull(rs.getString("edi_option"));
tranIdCol = checkNull(rs.getString("tran_id_col"));
tranIdCol = checkNull(rs.getString("tran_id_col")).toLowerCase();
}
rs.close();rs = null;
pstmt.close();pstmt = null;
if(tranIdCol != null)
{
tranIdCol = tranIdCol.trim();
}
System.out.println("ediOption["+ediOption+"]tranIdCol["+tranIdCol + "]");
tranId = checkNull(genericUtility.getColumnValue(tranIdCol, dom));
......@@ -107,9 +107,11 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
}
catch(Exception e)
{
System.out.println("iNSIDE CATCH......");
e.printStackTrace();
retString = dbEjb.getErrorString("", "POSFAIL", "");
throw new ITMException( e );
}
finally
{
......@@ -117,8 +119,7 @@ public class GenBatchPosSave extends ValidatorEJB implements GenBatchPosSaveLoca
{
if(isError)
{
conn.rollback();
System.out.println("Transaction rollback... ");
retString = dbEjb.getErrorString("", "POSFAIL", "");
}
}
catch(Exception e)
......
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