Commit 9ce1504b authored by arawankar's avatar arawankar

FinCommon.java

PayablesOpeningConf.java
-Result set close related changes done


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191032 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 919b81bb
...@@ -259,8 +259,9 @@ public class FinCommon ...@@ -259,8 +259,9 @@ public class FinCommon
{ {
sundrybalCnt = rs.getInt(1); sundrybalCnt = rs.getInt(1);
} }
stmt.close(); stmt = null;
rs.close(); rs = null; rs.close(); rs = null;
stmt.close(); stmt = null;
System.out.println("For Closing Prd : sundrybalCnt : " + sundrybalCnt); System.out.println("For Closing Prd : sundrybalCnt : " + sundrybalCnt);
} }
}//try }//try
...@@ -497,8 +498,9 @@ public class FinCommon ...@@ -497,8 +498,9 @@ public class FinCommon
{ {
ll_cnt = rs.getInt(1); ll_cnt = rs.getInt(1);
} }
stmt.close(); stmt = null;
rs.close(); rs = null; rs.close(); rs = null;
stmt.close(); stmt = null;
System.out.println("For Period 000000 ll_cnt : " + ll_cnt); System.out.println("For Period 000000 ll_cnt : " + ll_cnt);
}//try }//try
catch(SQLException se) catch(SQLException se)
...@@ -607,8 +609,9 @@ public class FinCommon ...@@ -607,8 +609,9 @@ public class FinCommon
{ {
ll_cnt = rs.getInt(1); ll_cnt = rs.getInt(1);
} }
stmt.close(); stmt = null;
rs.close(); rs = null; rs.close(); rs = null;
stmt.close(); stmt = null;
System.out.println("For Period zzzzzz ll_cnt : " + ll_cnt); System.out.println("For Period zzzzzz ll_cnt : " + ll_cnt);
} }
}//try }//try
......
...@@ -88,9 +88,9 @@ public class PayablesOpeningConf extends ActionHandlerEJB implements PayablesO ...@@ -88,9 +88,9 @@ public class PayablesOpeningConf extends ActionHandlerEJB implements PayablesO
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
conn.setAutoCommit(false); conn.setAutoCommit(false);
} }
catch(Exception ex) catch(Exception ex)
...@@ -127,11 +127,31 @@ conn = getConnection(); ...@@ -127,11 +127,31 @@ conn = getConnection();
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" + sqlHdr + se.getMessage()); System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" + sqlHdr + se.getMessage());
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][Start]
try
{
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][End]
se.printStackTrace(); se.printStackTrace();
} }
catch(Exception ex) catch(Exception ex)
{ {
System.out.println("Exception []"+ ex.getMessage()); System.out.println("Exception []"+ ex.getMessage());
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][Start]
try
{
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][End]
ex.printStackTrace(); ex.printStackTrace();
} }
if(confirmed == null) if(confirmed == null)
...@@ -200,11 +220,31 @@ conn = getConnection(); ...@@ -200,11 +220,31 @@ conn = getConnection();
catch(SQLException se) catch(SQLException se)
{ {
System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" + sql +se.getMessage()); System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" + sql +se.getMessage());
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][Start]
try
{
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][End]
} }
catch(Exception ex) catch(Exception ex)
{ {
System.out.println("Exception []::"+ex.getMessage()); System.out.println("Exception []::"+ex.getMessage());
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][Start]
try
{
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][End]
ex.printStackTrace(); ex.printStackTrace();
} }
totAmtOld = 0;//added by nisar on 06/02/08 totAmtOld = 0;//added by nisar on 06/02/08
...@@ -295,30 +335,42 @@ conn = getConnection(); ...@@ -295,30 +335,42 @@ conn = getConnection();
pstmt = conn.prepareStatement(sqlIns); pstmt = conn.prepareStatement(sqlIns);
//pstmt.setString(1,tranID);//Gulzar 04-12-06 //pstmt.setString(1,tranID);//Gulzar 04-12-06
pstmt.setString(1,payblsTranID.trim()); //Gulzar 04-12-06 /*pstmt.setString(1,payblsTranID.trim()); //Gulzar 04-12-06
pstmt.setString(2,tranSer.trim()); pstmt.setString(2,tranSer.trim());*/
pstmt.setString(1,checkNull(payblsTranID)); //Gulzar 04-12-06
pstmt.setString(2,checkNull(tranSer));
//pstmt.setTimestamp(3,tranDate); //pstmt.setTimestamp(3,tranDate);
pstmt.setTimestamp(3,new java.sql.Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(3,new java.sql.Timestamp(System.currentTimeMillis()));
pstmt.setString(4,refNo.trim()); //pstmt.setString(4,refNo.trim());
pstmt.setString(4,checkNull(refNo));
pstmt.setTimestamp(5,refDate); pstmt.setTimestamp(5,refDate);
pstmt.setString(6,billNo.trim()); //pstmt.setString(6,billNo.trim());
pstmt.setString(6,checkNull(billNo));
pstmt.setTimestamp(7,billDate); pstmt.setTimestamp(7,billDate);
pstmt.setString(8,currCode.trim()); //pstmt.setString(8,currCode.trim());
pstmt.setString(8,checkNull(currCode));
pstmt.setDouble(9,exchRate); pstmt.setDouble(9,exchRate);
pstmt.setString(10,sundryCode.trim()); /*pstmt.setString(10,sundryCode.trim());
pstmt.setString(11,acctCode.trim()); pstmt.setString(11,acctCode.trim());
pstmt.setString(12,cctrCode.trim()); pstmt.setString(12,cctrCode.trim());*/
pstmt.setString(10,checkNull(sundryCode));
pstmt.setString(11,checkNull(acctCode));
pstmt.setString(12,checkNull(cctrCode));
pstmt.setTimestamp(13,dueDate); pstmt.setTimestamp(13,dueDate);
pstmt.setString(14,siteCode.trim()); /*pstmt.setString(14,siteCode.trim());
pstmt.setString(15,finEntity.trim()); pstmt.setString(15,finEntity.trim());*/
pstmt.setString(14,checkNull(siteCode));
pstmt.setString(15,checkNull(finEntity));
pstmt.setDouble(16,totAmount); pstmt.setDouble(16,totAmount);
pstmt.setDouble(17,adjAmount); pstmt.setDouble(17,adjAmount);
pstmt.setString(18,sundryType.trim()); //pstmt.setString(18,sundryType.trim());
pstmt.setString(18,checkNull(sundryType));
pstmt.setString(19,payMode); pstmt.setString(19,payMode);
pstmt.setDouble(20,advAmount); pstmt.setDouble(20,advAmount);
pstmt.setString(21,purcOrder); pstmt.setString(21,purcOrder);
pstmt.setString(22,entryBatchNo); pstmt.setString(22,entryBatchNo);
pstmt.setString(23,refType.trim()); //pstmt.setString(23,refType.trim());
pstmt.setString(23,checkNull(refType));
pstmt.setDouble(24,suppBillAmt); pstmt.setDouble(24,suppBillAmt);
pstmt.setString(25,"U"); pstmt.setString(25,"U");
//pstmt.setTimestamp(26,tranDate); //pstmt.setTimestamp(26,tranDate);
...@@ -404,25 +456,33 @@ conn = getConnection(); ...@@ -404,25 +456,33 @@ conn = getConnection();
pstmt = conn.prepareStatement(sqlUpd); pstmt = conn.prepareStatement(sqlUpd);
//pstmt.setString(1,tranID.trim()); //pstmt.setString(1,tranID.trim());
pstmt.setString(1,tranSer.trim()); //pstmt.setString(1,tranSer.trim());
pstmt.setString(1,checkNull(tranSer));
//pstmt.setTimestamp(3,tranDate); //pstmt.setTimestamp(3,tranDate);
pstmt.setTimestamp(2,new java.sql.Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(2,new java.sql.Timestamp(System.currentTimeMillis()));
pstmt.setTimestamp(3,refDate); pstmt.setTimestamp(3,refDate);
pstmt.setString(4,billNo.trim()); //pstmt.setString(4,billNo.trim());
pstmt.setString(4,checkNull(billNo));
pstmt.setTimestamp(5,billDate); pstmt.setTimestamp(5,billDate);
pstmt.setString(6,currCode.trim()); //pstmt.setString(6,currCode.trim());
pstmt.setString(6,checkNull(currCode));
pstmt.setDouble(7,exchRate); pstmt.setDouble(7,exchRate);
pstmt.setString(8,sundryCode.trim()); /*pstmt.setString(8,sundryCode.trim());
pstmt.setString(9,acctCode.trim()); pstmt.setString(9,acctCode.trim());
pstmt.setString(10,cctrCode.trim()); pstmt.setString(10,cctrCode.trim());*/
pstmt.setString(8,checkNull(sundryCode));
pstmt.setString(9,checkNull(acctCode));
pstmt.setString(10,checkNull(cctrCode));
pstmt.setTimestamp(11,dueDate); pstmt.setTimestamp(11,dueDate);
pstmt.setString(12,finEntity.trim()); //pstmt.setString(12,finEntity.trim());
pstmt.setString(12,checkNull(finEntity));
pstmt.setDouble(13,amountDiff); pstmt.setDouble(13,amountDiff);
pstmt.setDouble(14,adjAmount); pstmt.setDouble(14,adjAmount);
pstmt.setString(15,"U"); pstmt.setString(15,"U");
pstmt.setTimestamp(16,new java.sql.Timestamp(System.currentTimeMillis())); pstmt.setTimestamp(16,new java.sql.Timestamp(System.currentTimeMillis()));
//pstmt.setTimestamp(17,tranDate); //pstmt.setTimestamp(17,tranDate);
pstmt.setString(17,sundryType.trim()); //pstmt.setString(17,sundryType.trim());
pstmt.setString(17,checkNull(sundryType));
pstmt.setString(18,payMode); pstmt.setString(18,payMode);
pstmt.setDouble(19,advAmount); pstmt.setDouble(19,advAmount);
pstmt.setString(20,purcOrder); pstmt.setString(20,purcOrder);
...@@ -455,7 +515,7 @@ conn = getConnection(); ...@@ -455,7 +515,7 @@ conn = getConnection();
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception [11][confirmPayablesOpening][Excuting Query Failed]" + sqlUpd + e.getMessage()); System.out.println("Exception [12][confirmPayablesOpening][Excuting Query Failed]" + sqlUpd + e.getMessage());
//Modified by Anjali R. on[20/09/2018][Start] //Modified by Anjali R. on[20/09/2018][Start]
try try
{ {
...@@ -559,6 +619,16 @@ conn = getConnection(); ...@@ -559,6 +619,16 @@ conn = getConnection();
catch(SQLException se) catch(SQLException se)
{ {
se.printStackTrace(); se.printStackTrace();
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][Start]
try
{
conn.rollback();
}
catch(Exception e)
{
System.out.println("Exception --["+ e.getMessage()+"]");
}
//Modified by Anjali R. on[20/09/2018][In case of exception,rollback the entire transaction][End]
System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" +sql+ se.getMessage()); System.out.println("SQLException []:[PayablesOpeningConfEJB][Excuting Query Failed]" +sql+ se.getMessage());
} }
sundrybalMap.put("contact_code",contactCode); sundrybalMap.put("contact_code",contactCode);
...@@ -779,4 +849,18 @@ conn = getConnection(); ...@@ -779,4 +849,18 @@ conn = getConnection();
System.out.println("retString ::"+retString); System.out.println("retString ::"+retString);
return retString; return retString;
}//confirm() }//confirm()
//Modified by Anjali R. on[20/09/2018][Added new method to check null][Start]
private static String checkNull(String input)
{
if (input == null)
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
//Modified by Anjali R. on[20/09/2018][Added new method to check null][End]
}//class }//class
\ 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