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