Commit ffb71454 authored by prane's avatar prane

Closing Resultset,statements and prepared statements

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191839 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 382f169d
......@@ -1155,6 +1155,14 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
+ " group by sord_no,sord_line_no,item_code,tax_class,tax_chap,tax_env");
pstmt.setString(1,tranId);
rs=pstmt.executeQuery();
//Changed by Pavan R 10oct18[to handle open cursor issue]
sql="update invdet set tax_class=?,tax_chap=?,tax_env=?,tax_amt=tax_amt+?,net_amt=net_amt+?"
+ " where invoice_id=? "
+ " and sord_no=? "
+ " and sord_line_no=?"
+ " and item_code=?";
pstmt1=conn.prepareStatement(sql);
//Changed by Pavan R 10oct18 end
while(rs.next())
{
sordNo=rs.getString(1);
......@@ -1175,13 +1183,13 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
//+ " and sord_line_no=?";
+ " and line_no=?";*/
//Changes and Commented By Ajay on 18-01-2018:START
sql="update invdet set tax_class=?,tax_chap=?,tax_env=?,tax_amt=tax_amt+?,net_amt=net_amt+?"
/*sql="update invdet set tax_class=?,tax_chap=?,tax_env=?,tax_amt=tax_amt+?,net_amt=net_amt+?"
+ " where invoice_id=? "
+ " and sord_no=? "
+ " and sord_line_no=?"
//+ " and line_no=?";
+ " and item_code=?";
pstmt1=conn.prepareStatement(sql);
pstmt1=conn.prepareStatement(sql);*/
pstmt1.setString(1,taxClass);
pstmt1.setString(2,taxChap);
pstmt1.setString(3,taxEnv);
......@@ -1194,6 +1202,7 @@ public class PostOrdInvoiceGen extends ActionHandlerEJB
pstmt1.setString(8,soLineNo);
pstmt1.setString(9,itemCode);
pstmt1.executeUpdate();
pstmt1.clearParameters();
}
rs.close();
......
......@@ -109,7 +109,8 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
itemSer=rs2.getString("item_ser");
netamt=rs2.getDouble("net_amt");
}
rs2.close();//added by Pavan R 10oct18[to handle open cursor issue]
rs2 = null; pstmt2.close(); pstmt2 = null;
sql="select round, case when round_to is null then 0.001 else round_to end as round_to " +
" from customer where cust_code = ?";
......@@ -153,6 +154,8 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
pstmt2.setDouble(2,netamtr-netamt);
pstmt2.setString(3,invoiceId);
int count=pstmt2.executeUpdate();
pstmt2.close();//added by Pavan R 10oct18[to handle open cursor issue]
pstmt2 = null;
System.out.println("count++++"+count);
//xmlBuff.append("<round_adj><![CDATA["+(netamt-netAmt)+"]]></round_adj>");
......@@ -167,6 +170,8 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
pstmt2.setDouble(2,netamtr-netamt);
pstmt2.setString(3,invoiceId);
int count=pstmt2.executeUpdate();
pstmt2.close();//added by Pavan R 10oct18[to handle open cursor issue]
pstmt2 = null;
System.out.println("count1++++"+count);
//xmlBuff.append("<round_adj><![CDATA["+(netamt-netamtr)+"]]></round_adj>");
//xmlBuff.append("<net_amt><![CDATA["+netamt+"]]></net_amt>");
......@@ -898,6 +903,8 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
System.out.println("ln_amount_radj+++++++"+ln_amount_radj);
}
rs2.close();//added by Pavan R 10oct18[to handle open cursor issue]
rs2 = null; pstmt2.close(); pstmt2 = null;
ls_acct_code__radj =checkNull(finCommon.getFinparams("999999","ROUND_ADJUST_ACCT", conn));
ls_cctr_code__radj = checkNull(finCommon.getFinparams("999999","ROUND_ADJUST_CCTR", conn));
......@@ -1996,7 +2003,8 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
pstmt.setString(22, linkType);
pstmt.setString(23, remarks);
pstmt.executeUpdate();
pstmt.close();//added by Pavan R 10oct18[to handle open cursor issue]
pstmt = null;
sql = " insert into rcp_ibca_det (tran_id, ref_ser, ref_no, ref_date, curr_code, exch_rate, "
+" cust_code, acct_code, cctr_code, due_date, tot_amt, discount,tax_amt, bank_code, "
+" ref_type, auto_rcp, sales_pers, item_ser, sales_pers__1, sales_pers__2, cr_term, "
......@@ -2034,7 +2042,8 @@ public class PostOrdInvoicePost extends ActionHandlerEJB implements PostOrdInvoi
pstmt.setTimestamp(29, gpDate);
pstmt.setTimestamp(30, discountDate);
pstmt.executeUpdate();
pstmt.close();//Changed by Pavan R 10oct18[to handle open cursor issue]
pstmt = null;
RcvIbcaConf ibcaObj = new RcvIbcaConf();
retString = ibcaObj.retreiveRibca (ibcaID, siteCode, xtraParamsStr, conn);
......
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