Commit bf25c626 authored by prane's avatar prane

statement changed to prepared statement and closed and null set to cursor and pstmt

conn change

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@197669 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e8d8a4f6
...@@ -5103,14 +5103,22 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5103,14 +5103,22 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
String ls_date = "", merrcode =""; String ls_date = "", merrcode ="";
Date currentDate = new Date(); Date currentDate = new Date();
PreparedStatement pstmt=null; PreparedStatement pstmt=null;
boolean connStatus = false;
int updCnt=0; int updCnt=0;
try try
{ {
connCP = getConnection(); //23feb19 Pavan R[commented and changed to avoid unnecessary conn creation]
if(connCP == null)
{
//connCP = getConnection();
connCP = getConnection() ;
connCP.setAutoCommit(false);
connStatus = true;
}
//23feb19 Pavan R end
BaseLogger.log("3", null, null, "start calling postLog........"); BaseLogger.log("3", null, null, "start calling postLog........");
//System.out.println(" start calling postLog........"); //System.out.println(" start calling postLog........");
ls_date = sdf.format(currentDate); ls_date = sdf.format(currentDate);
...@@ -5210,7 +5218,31 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5210,7 +5218,31 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
}//23feb19 Pavan R[to close open resources]
finally
{
try
{
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( connCP != null && !connCP.isClosed() && connStatus )
{
connCP.close();
connCP = null;
}
}
catch(Exception e)
{
BaseLogger.log("0", null, null, "Exception in PostOrderProcess :: postLog():: finally::"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
} }
//23feb19 Pavan R end
return merrcode; return merrcode;
} }
......
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