Commit 0217d9a7 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@197665 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4f06009f
...@@ -2,6 +2,7 @@ package ibase.webitm.ejb.dis; ...@@ -2,6 +2,7 @@ package ibase.webitm.ejb.dis;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.BaseLogger;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.E12CreateBatchLoadEjb; import ibase.webitm.ejb.E12CreateBatchLoadEjb;
...@@ -4978,21 +4979,30 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -4978,21 +4979,30 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
String ls_reas_detail = "", merrcode = ""; String ls_reas_detail = "", merrcode = "";
////// added arun ////// added arun
ITMDBAccessEJB itmDBAccessEJB = null; ITMDBAccessEJB itmDBAccessEJB = null;
boolean connStatus=false;
try try
{ {
connCP = getConnection() ; //23feb19 Pavan R[commented and changed to avoid unnecessary conn creation]
//connCP = getConnection() ;
if(conn == null)
{
conn = getConnection() ;
conn.setAutoCommit(false);
connStatus = true;
}
//23feb19 Pavan R end
//if(postLogYn) //if(postLogYn)
//{ //{
System.out.println("call errorLog!!!!!!!...."); //System.out.println("call errorLog!!!!!!!....");
System.out.println("as_reas_detail.trim().length()>>>"+as_reas_detail.trim().length()); //System.out.println("as_reas_detail.trim().length()>>>"+as_reas_detail.trim().length());
BaseLogger.log("3", null, null, "call errorLog!!!!!!!....as_reas_detail.trim().length()>>>"+as_reas_detail.trim().length());
if(as_reas_detail.trim().length() == 0) if(as_reas_detail.trim().length() == 0)
{ {
sql = " select descr from gencodes where " + sql = " select descr from gencodes where " +
" fld_name = ? and ltrim(rtrim(fld_value))= ? and " + " fld_name = ? and ltrim(rtrim(fld_value))= ? and " +
" ltrim(rtrim(mod_name)) = ? "; " ltrim(rtrim(mod_name)) = ? ";
pstmt = connCP.prepareStatement(sql); //pstmt = connCP.prepareStatement(sql);
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gencode_fldname); pstmt.setString(1,gencode_fldname);
pstmt.setString(2,as_reas_code); pstmt.setString(2,as_reas_code);
pstmt.setString(3,mod_name); pstmt.setString(3,mod_name);
...@@ -5012,12 +5022,16 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5012,12 +5022,16 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
as_reas_detail = ls_reas_detail; as_reas_detail = ls_reas_detail;
} }
System.out.println("as_reas_detail :"+as_reas_detail); /*System.out.println("as_reas_detail :"+as_reas_detail);
System.out.println("as_table_name["+as_table_name+"]"+"keyfld1["+keyfld1+"]"+"keyfld2["+keyfld2+"]"); System.out.println("as_table_name["+as_table_name+"]"+"keyfld1["+keyfld1+"]"+"keyfld2["+keyfld2+"]");
System.out.println("keyfld3["+keyfld3+"]"+"keyfld4["+keyfld4+"]"+"keyfld5["+keyfld5+"]"); System.out.println("keyfld3["+keyfld3+"]"+"keyfld4["+keyfld4+"]"+"keyfld5["+keyfld5+"]");
System.out.println("as_tran_id["+as_tran_id+"]"+"as_tran_code["+as_tran_code+"]"+"gencode_fldname["+gencode_fldname+"]"); System.out.println("as_tran_id["+as_tran_id+"]"+"as_tran_code["+as_tran_code+"]"+"gencode_fldname["+gencode_fldname+"]");
System.out.println("mod_name:"+mod_name); System.out.println("mod_name:"+mod_name);*/
BaseLogger.log("3", null, null, "as_reas_detail :"+as_reas_detail);
BaseLogger.log("3", null, null, "as_table_name["+as_table_name+"]"+"keyfld1["+keyfld1+"]"+"keyfld2["+keyfld2+"]");
BaseLogger.log("3", null, null, "keyfld3["+keyfld3+"]"+"keyfld4["+keyfld4+"]"+"keyfld5["+keyfld5+"]");
BaseLogger.log("3", null, null, "as_tran_id["+as_tran_id+"]"+"as_tran_code["+as_tran_code+"]"+"gencode_fldname["+gencode_fldname+"]");
BaseLogger.log("3", null, null, "mod_name:"+mod_name);
Log log = new Log(); Log log = new Log();
log.setReasCode(as_reas_code); log.setReasCode(as_reas_code);
log.setReasDetail(as_reas_detail); log.setReasDetail(as_reas_detail);
...@@ -5032,17 +5046,47 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5032,17 +5046,47 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
log.setGencodeFldname(gencode_fldname); log.setGencodeFldname(gencode_fldname);
log.setModName(mod_name); log.setModName(mod_name);
merrcode=postLog(log,conn);
merrcode=postLog(log,connCP); //merrcode=postLog(log,connCP);
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println(e.getMessage()); BaseLogger.log("0", null, null, "Exception in PostOrderProcess :: errorLog()::"+e.getMessage());
//System.out.println(e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
//23feb19 Pavan R[to close open resources]
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if( conn != null && !conn.isClosed() && connStatus )
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
BaseLogger.log("0", null, null, "Exception in PostOrderProcess :: errorLog():: finally::"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
}
//23feb19 Pavan R end
return merrcode; return merrcode;
} }
...@@ -5067,8 +5111,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5067,8 +5111,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
try try
{ {
connCP = getConnection(); connCP = getConnection();
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);
// System.out.println("ls_date :"+ls_date); // System.out.println("ls_date :"+ls_date);
ls_table = checkNull(log.getTableName()); ls_table = checkNull(log.getTableName());
...@@ -5096,7 +5140,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5096,7 +5140,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
else else
{ {
System.out.println("Update reason code and reason deatils and line no and exp_value<<<<<<<>>>>>>>["+sql+"]"); //System.out.println("Update reason code and reason deatils and line no and exp_value<<<<<<<>>>>>>>["+sql+"]");
BaseLogger.log("3", null, null, "Update reason code and reason deatils and line no and exp_value<<<<<<<>>>>>>>["+sql+"]");
sql = "update sorditem set reas_code = ? , " + sql = "update sorditem set reas_code = ? , " +
" reas_detail = ? where sale_order = ? " + " reas_detail = ? where sale_order = ? " +
" and ( (line_no = ?) or (? ='') ) and " + " and ( (line_no = ?) or (? ='') ) and " +
...@@ -5114,7 +5159,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca ...@@ -5114,7 +5159,8 @@ public class PostOrderProcess extends ProcessEJB implements PostOrderProcessLoca
} }
else else
{ {
System.out.println("@@@@@@@@@@@ keyfld2 and keyfld3 value "+keyfld2+"]"); //System.out.println("@@@@@@@@@@@ keyfld2 and keyfld3 value "+keyfld2+"]");
BaseLogger.log("3", null, null, "@@@@@@@@@@@ keyfld2 and keyfld3 value "+keyfld2+"]");
pstmt.setString(1,ls_reas_code); pstmt.setString(1,ls_reas_code);
pstmt.setString(2,ls_reas_detail); pstmt.setString(2,ls_reas_detail);
pstmt.setString(3,keyfld1); pstmt.setString(3,keyfld1);
...@@ -5903,4 +5949,4 @@ class Log ...@@ -5903,4 +5949,4 @@ class Log
} }
\ No newline at end of file
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