Commit b7d497f2 authored by sanashaikh's avatar sanashaikh

Sana S:Modified on 26/08/2019

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@206234 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0bae6226
......@@ -5,11 +5,12 @@ import java.rmi.RemoteException;
import java.sql.*;
import ibase.webitm.utility.*;
import ibase.system.config.*;
//import ibase.system.config.*;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.*;
import ibase.webitm.ejb.adm.AdmCommon;
import javax.naming.InitialContext;
//import javax.naming.InitialContext;
/**
......@@ -49,8 +50,8 @@ public class EmpLvePrkBalTrfCanc extends ActionHandlerEJB implements EmpLvePrkBa
{
try
{
if( conn != null )
{
/*if( conn != null )// Modified by Sana S on 27/08/2019
{*/
if( errorFound )
{
System.out.println("Rolling Back Changes......");
......@@ -62,10 +63,11 @@ public class EmpLvePrkBalTrfCanc extends ActionHandlerEJB implements EmpLvePrkBa
conn.commit();
System.out.println("Commiting Changes......11");
}
conn.close();
conn = null;
// Modified by Sana S on 27/08/2019
//conn.close();
//conn = null;
}
}
//}
catch(Exception e)
{
System.out.println("EmpLvePrkBalTrfCanc :cancel :==>\n" + e);
......@@ -83,24 +85,22 @@ public class EmpLvePrkBalTrfCanc extends ActionHandlerEJB implements EmpLvePrkBa
{
PreparedStatement pstmt = null;
ResultSet rs = 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]
String retString="";
String sql = "";
String status="";
String tranMode = "";
int updCnt = 0;
GenericUtility genericUtility = GenericUtility.getInstance();
//Modified by Sana S on 27/08/2019
//GenericUtility genericUtility = GenericUtility.getInstance();
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
//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 = new ITMDBAccessEJB();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
itmDBAccess = new ITMDBAccessEJB();// Modified by Sana S on 27/08/2019
String userId = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "loginEmpCode" );
......@@ -117,31 +117,28 @@ public class EmpLvePrkBalTrfCanc extends ActionHandlerEJB implements EmpLvePrkBa
if ( "R".equalsIgnoreCase( tranMode ) )
{
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTELPTRF12", userId );
retString = itmDBAccess.getErrorString("","VTELPTRF12",userId,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
retString = itmDBAccess.getErrorString("", "VTELPTRF12", userId, "", conn);// Modified by Sana S on 27/08/2019
}
else if ( "C".equalsIgnoreCase( status ) )
{
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTELPTRF13", userId );
retString = itmDBAccess.getErrorString("","VTELPTRF13",userId,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
retString = itmDBAccess.getErrorString( "", "VTELPTRF13", userId,"",conn );// Modified by Sana S on 27/08/2019
}
else if( "X".equalsIgnoreCase( status ) )
{
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTELPTRF14", userId );
retString = itmDBAccess.getErrorString("","VTELPTRF14",userId,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
retString = itmDBAccess.getErrorString( "", "VTELPTRF14", userId,"",conn );// Modified by Sana S on 27/08/2019
}
else
{
System.out.println("In For Update:");
sql=" UPDATE EMP_LVEPRKBAL_TRFHDR SET STATUS = ?, STATUS_DATE = ?, EMP_CODE__CONF = ? WHERE TRAN_ID= ? ";
pstmt = conn.prepareStatement( sql );
pstmt.setString( 1, "X" );
System.out.println("In For Update1:");
pstmt.setTimestamp( 2, new java.sql.Timestamp( System.currentTimeMillis() ) );
System.out.println("In For Update2:"+new java.sql.Timestamp( System.currentTimeMillis() ));
// Added by Varsha V on 16/07/18 for updating EMP_CODE__CONF also
pstmt.setString( 3, userId );
// Ended by Varsha V on 16/07/18 for updating EMP_CODE__CONF also
......@@ -151,10 +148,8 @@ public class EmpLvePrkBalTrfCanc extends ActionHandlerEJB implements EmpLvePrkBa
if( updCnt > 0 )
{
conn.commit();
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [START]
//retString = itmDBAccess.getErrorString( "", "VTELPTRF15", userId );
retString = itmDBAccess.getErrorString("","VTELPTRF15",userId,"",conn);
//Added and commented by sarita on to call getErrorString connection method on 20 JULY 2018 [END]
retString = itmDBAccess.getErrorString( "", "VTELPTRF15", userId,"",conn);// Modified by Sana S on 27/08/2019
}
close( pstmt, rs );
}
......@@ -184,10 +179,12 @@ public class EmpLvePrkBalTrfCanc extends ActionHandlerEJB implements EmpLvePrkBa
{
try
{
//Added by sarita on 25 JULY 18 [START]
itmDBAccess = null;
//Added by sarita on 25 JULY 18 [END]
close( pstmt, rs );
if(conn!=null)
{
close( pstmt, rs );
conn.close();
conn=null;
}
}
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