Commit 5eb31a4a authored by sakhtar's avatar sakhtar

added method which takes connection


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91779 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fbb39d40
...@@ -42,15 +42,47 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -42,15 +42,47 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
public void setSessionContext(SessionContext se){ public void setSessionContext(SessionContext se){
}*/ }*/
public String confirm(String tranID,String xtraParams, String forcedFlag) throws RemoteException,ITMException
{
String retString = "",errCode = "",confirmed = "";
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
boolean isError = false;
ResultSet rs = null;
PreparedStatement pStmt = null;
String actionSet = "";
boolean isConn= true;
try
{
conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false);
connDriver = null;
public String confirm(String tranId,String xtraParams, String forcedFlag) throws RemoteException,ITMException retString =this.confirm( tranID,xtraParams, forcedFlag ,conn ,isConn);
if ( retString != null && retString.length() > 0 )
{
throw new Exception("Exception while calling confirm for tran Id:["+tranID+"]");
}
}
catch(Exception exception)
{
System.out.println("Exception in [InvHoldConfEJB] getCurrdateAppFormat " + exception.getMessage());
}
return retString;
}
public String confirm(String tranId,String xtraParams, String forcedFlag ,Connection conn,boolean isConn) throws RemoteException,ITMException
{ {
Connection conn = null; // Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql = ""; String sql = "";
ConnDriver connDriver = null; // ConnDriver connDriver = null;
String loginEmpCode = null; String loginEmpCode = null;
ibase.webitm.utility.GenericUtility genericUtility = null; ibase.webitm.utility.GenericUtility genericUtility = null;
...@@ -114,9 +146,9 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -114,9 +146,9 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
itmDBAccessEJB = new ITMDBAccessEJB(); itmDBAccessEJB = new ITMDBAccessEJB();
genericUtility = ibase.webitm.utility.GenericUtility.getInstance(); genericUtility = ibase.webitm.utility.GenericUtility.getInstance();
connDriver = new ConnDriver(); // connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM"); // conn = connDriver.getConnectDB("DriverITM");
conn.setAutoCommit(false); // conn.setAutoCommit(false);
loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); loginEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
//check if there is record in detal //check if there is record in detal
...@@ -555,8 +587,11 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -555,8 +587,11 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
return errString; return errString;
} }
else else
{ { // added by shamim
conn.commit(); if(isConn)
{
conn.commit();
}
errString = itmDBAccessEJB.getErrorString("","VTCNFSUCC",""); errString = itmDBAccessEJB.getErrorString("","VTCNFSUCC","");
System.out.println("Returnng String From InvHoldRelConfEJB : .." + errString); System.out.println("Returnng String From InvHoldRelConfEJB : .." + errString);
} }
...@@ -618,11 +653,12 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo ...@@ -618,11 +653,12 @@ public class InvHoldRelConf extends ActionHandlerEJB implements InvHoldRelConfLo
//changed by Dharmesh on 12-08-2011 [WM1ESUN004] to close preparedStatements and to make null.end //changed by Dharmesh on 12-08-2011 [WM1ESUN004] to close preparedStatements and to make null.end
if(conn != null) if(conn != null && isConn ==true)
{ {
conn.close(); conn.close();
conn = null;
} }
conn = null;
}catch(Exception e){System.out.println("Exception : "+e);e.printStackTrace();} }catch(Exception e){System.out.println("Exception : "+e);e.printStackTrace();}
} }
System.out.println("InvHoldRelConfEJB :"+errString); System.out.println("InvHoldRelConfEJB :"+errString);
......
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