Commit 868c58d0 authored by ssalve's avatar ssalve

Sarita : Done changes to 1. remove Lookup for ITMDBAccessEJB and created...

Sarita : Done changes to 1. remove Lookup for ITMDBAccessEJB and created object and  2. use connection method of ITMDBAccessEJB for calling getErrorString 

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187972 ce508802-f39f-4f6c-b175-0d175dae99d5
parent abc2810c
......@@ -30,9 +30,10 @@ public class HolChangeCanc extends ActionHandlerEJB implements HolChangeCancLoca
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
ITMDBAccessLocal itmDBAccess = null;
//Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[START]
//ITMDBAccessLocal itmDBAccess = null;
ITMDBAccessEJB itmDBAccess = null;
//Added & Commented by sarita to use object of ITMDBAccessEJB instead ITMDBAccessLocal on 20 JULY 18.[END]
int updStatus = 0;
String sql = "";
......@@ -60,9 +61,12 @@ public class HolChangeCanc extends ActionHandlerEJB implements HolChangeCancLoca
System.out.println(" xtraParams [" + xtraParams + "] ");
System.out.println(" forcedFlag [" + forcedFlag + "] ");
AppConnectParm appConnect = new AppConnectParm();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [START]
/*AppConnectParm appConnect = new AppConnectParm();
InitialContext ctx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local");
itmDBAccess = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local");*/
itmDBAccess = new ITMDBAccessEJB();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
System.out.println(" I N S I D E C A S E ");
System.out.println("tranId [" + tranId + "]");
......@@ -87,11 +91,10 @@ public class HolChangeCanc extends ActionHandlerEJB implements HolChangeCancLoca
System.out.println("TO DATE STRING AFTER DBDATE [" + holDateToSql + "]");
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
System.out.println("emp Code [" + empCode + "] hol date for [" + holDateForSql + "] hol date to [" + holDateToSql + "] hol type" +holType );
......@@ -113,7 +116,10 @@ public class HolChangeCanc extends ActionHandlerEJB implements HolChangeCancLoca
}
else
{
retString = itmDBAccess.getErrorString("emp_code", "VTHOLCHG02", userID);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString("emp_code", "VTHOLCHG02", userID);
retString = itmDBAccess.getErrorString("emp_code","VTHOLCHG02",userID,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
}
System.out.println(" confirm [" + confirm + "] ");
......@@ -140,20 +146,28 @@ public class HolChangeCanc extends ActionHandlerEJB implements HolChangeCancLoca
System.out.println("canceled the request [::" + updStatus);
if(updStatus > 0)
{
retString = itmDBAccess.getErrorString("emp_code", "VTCANC1", userID);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString("emp_code", "VTCANC1", userID);
retString = itmDBAccess.getErrorString("emp_code","VTCANC1",userID,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
conn.commit();
}
else
{
retString = itmDBAccess.getErrorString("emp_code", "VTHOLCHG02", userID);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString("emp_code", "VTHOLCHG02", userID);
retString = itmDBAccess.getErrorString("emp_code","VTHOLCHG02",userID,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
conn.rollback();
}
}
else
{
retString = itmDBAccess.getErrorString("emp_code", "VTCANC2", userID);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString("emp_code", "VTCANC2", userID);
retString = itmDBAccess.getErrorString("emp_code","VTCANC2",userID,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
}
}
}
......
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