Commit e6864acb authored by akhokar's avatar akhokar

Changes done for connection not getting closed

PaymentExpPaid.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@200740 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7470fae6
...@@ -6,14 +6,17 @@ Action : The voucher will be paid.It will update CONFIRMED field of PAYMENT ...@@ -6,14 +6,17 @@ Action : The voucher will be paid.It will update CONFIRMED field of PAYMENT
package ibase.webitm.ejb.fin.adv; package ibase.webitm.ejb.fin.adv;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.*; import java.sql.Connection;
import javax.ejb.*; import java.sql.ResultSet;
import java.sql.Statement;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import ibase.system.config.*;
import javax.ejb.Stateless; // added for ejb3 import javax.ejb.Stateless; // added for ejb3
import ibase.system.config.ConnDriver;
import ibase.webitm.ejb.ActionHandlerEJB;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.utility.ITMException;
@Stateless // added for ejb3 @Stateless // added for ejb3
public class PaymentExpPaid extends ActionHandlerEJB implements PaymentExpPaidLocal,PaymentExpPaidRemote // SessionBean public class PaymentExpPaid extends ActionHandlerEJB implements PaymentExpPaidLocal,PaymentExpPaidRemote // SessionBean
...@@ -45,14 +48,16 @@ public class PaymentExpPaid extends ActionHandlerEJB implements PaymentExpPaidLo ...@@ -45,14 +48,16 @@ public class PaymentExpPaid extends ActionHandlerEJB implements PaymentExpPaidLo
String varValue = ""; String varValue = "";
Connection conn = null; Connection conn = null;
String retString = ""; String retString = "";
ConnDriver connDriver = new ConnDriver(); //Modified by Azhar K. on [13-05-2019][To do changes for connection not getting closed][Start]
//ConnDriver connDriver = new ConnDriver();
//Modified by Azhar K. on [13-05-2019][To do changes for connection not getting closed][End]
try try
{ {
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
//Changes and Commented By Bhushan on 06-06-2016 :START //Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END //Changes and Commented By Bhushan on 06-06-2016 :END
varValue = itmDBAccessEJB.getEnvFin("999999","DIRECT_PAY_PAID",conn); varValue = itmDBAccessEJB.getEnvFin("999999","DIRECT_PAY_PAID",conn);
if (varValue.equalsIgnoreCase("Y")) if (varValue.equalsIgnoreCase("Y"))
{ {
...@@ -65,6 +70,24 @@ conn = getConnection(); ...@@ -65,6 +70,24 @@ conn = getConnection();
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
//Modified by Azhar K. on [13-05-2019][To do changes for connection not getting closed][Start]
finally
{
try
{
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
}
//Modified by Azhar K. on [13-05-2019][To do changes for connection not getting closed][End]
return retString; return retString;
} }
//Default Button //Default Button
...@@ -83,9 +106,9 @@ conn = getConnection(); ...@@ -83,9 +106,9 @@ conn = getConnection();
try try
{ {
//Changes and Commented By Bhushan on 06-06-2016 :START //Changes and Commented By Bhushan on 06-06-2016 :START
//conn = connDriver.getConnectDB("DriverITM"); //conn = connDriver.getConnectDB("DriverITM");
conn = getConnection(); conn = getConnection();
//Changes and Commented By Bhushan on 06-06-2016 :END //Changes and Commented By Bhushan on 06-06-2016 :END
sql = "SELECT CASE WHEN CONFIRMED IS NULL THEN 'N' ELSE CONFIRMED END FROM PAYMENT_EXP WHERE TRAN_ID = '"+ tranID +"'"; sql = "SELECT CASE WHEN CONFIRMED IS NULL THEN 'N' ELSE CONFIRMED END FROM PAYMENT_EXP WHERE TRAN_ID = '"+ tranID +"'";
stmt = conn.createStatement(); stmt = conn.createStatement();
rs = stmt.executeQuery(sql); rs = stmt.executeQuery(sql);
......
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