Commit 790d1ff8 authored by pborate's avatar pborate

Updated changes for connection close in planvsactual class

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@189950 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 90dc8f70
...@@ -1731,6 +1731,10 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -1731,6 +1731,10 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
} }
System.out.println("missCallArray == > " +missCallArray); System.out.println("missCallArray == > " +missCallArray);
missedCallData = missCallArray.toString(); missedCallData = missCallArray.toString();
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
catch(Exception e) catch(Exception e)
{ {
...@@ -1778,10 +1782,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -1778,10 +1782,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
org.json.JSONObject rawDataPlanDtlJson = new org.json.JSONObject(); org.json.JSONObject rawDataPlanDtlJson = new org.json.JSONObject();
String sql = ""; String sql = "";
ResultSet rs = null;
PreparedStatement pstmt = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
DashboardUtility dashboardUtility = null; DashboardUtility dashboardUtility = null;
E12GenericUtility e12GenUtility = new E12GenericUtility(); E12GenericUtility e12GenUtility = new E12GenericUtility();
String sourceDateFormat=e12GenUtility.getApplDateFormat(); String sourceDateFormat=e12GenUtility.getApplDateFormat();
...@@ -1801,8 +1801,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -1801,8 +1801,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
{ {
salePersons = salePersons == null ? "": salePersons.trim(); salePersons = salePersons == null ? "": salePersons.trim();
dashboardUtility = new DashboardUtility(); dashboardUtility = new DashboardUtility();
conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;
SimpleDateFormat sdf = new SimpleDateFormat(e12GenUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(e12GenUtility.getApplDateFormat());
currentDate = sdf.format(new java.util.Date()); currentDate = sdf.format(new java.util.Date());
currentDate=e12GenUtility.getValidDateString(currentDate, sourceDateFormat, targetDateFormat); currentDate=e12GenUtility.getValidDateString(currentDate, sourceDateFormat, targetDateFormat);
...@@ -1854,29 +1852,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -1854,29 +1852,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
System.out.println("Exception in getTodaysMyData " + e.getMessage()); System.out.println("Exception in getTodaysMyData " + e.getMessage());
throw new ITMException(e); throw new ITMException(e);
} }
finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in getTodaysMyData " + d.getMessage());
throw new ITMException(d);
}
}
return rawDataPlanDtlJson; return rawDataPlanDtlJson;
} }
...@@ -1995,12 +1970,44 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -1995,12 +1970,44 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
sourceDes.put("ACTIVITY_END_LOCALITY",destination); sourceDes.put("ACTIVITY_END_LOCALITY",destination);
} }
System.out.println("sourceDes :::::2 "+sourceDes); System.out.println("sourceDes :::::2 "+sourceDes);
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} }
catch (Exception e) { catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
System.out.println("inside getSourceDestination exception "+e); System.out.println("inside getSourceDestination exception "+e);
e.printStackTrace(); e.printStackTrace();
} }
finally
{
try
{
if (conn != null)
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
conn = null;
}
}
catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in PlanVsActual.getSourceDestination() " + d.getMessage());
throw new ITMException(d);
}
}
System.out.println("getSourceDestination final json data "+sourceDes); System.out.println("getSourceDestination final json data "+sourceDes);
return sourceDes; return sourceDes;
...@@ -2066,19 +2073,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -2066,19 +2073,6 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
visitSummaryMap.put(shDescr, ""+count1); visitSummaryMap.put(shDescr, ""+count1);
listedCount=listedCount+count1; listedCount=listedCount+count1;
// if(shDescr.equalsIgnoreCase("DOCTOR")) {
// visitSummerObj.put("OPTION_NAME", "Doctor");
// visitSummerObj.put("OPTION_VALUE", count1);
// }
// if(shDescr.equalsIgnoreCase("CHEMIST")) {
// visitSummerObj.put("OPTION_NAME", "Retailer");
// visitSummerObj.put("OPTION_VALUE", count1);
// }
// if(shDescr.equalsIgnoreCase("STOCKIST")) {
// visitSummerObj.put("OPTION_NAME", "Distributer");
// visitSummerObj.put("OPTION_VALUE", count1);
// }
// visitSummeryArray.add(visitSummerObj);
} }
String drCount = visitSummaryMap.get("DOCTOR"); String drCount = visitSummaryMap.get("DOCTOR");
...@@ -2161,8 +2155,10 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -2161,8 +2155,10 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
visitObj.put("TODAYS_SUMMARY", todaySummeryArray); visitObj.put("TODAYS_SUMMARY", todaySummeryArray);
visitObj.put("UNLISTED_DOC_STR", ScCodeStr); visitObj.put("UNLISTED_DOC_STR", ScCodeStr);
//finalArray.add(todaysSummyObj); rs.close();
//finalArray.add(visitObj); rs = null;
pstmt.close();
pstmt = null;
} }
catch (Exception e) { catch (Exception e) {
...@@ -2170,6 +2166,34 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -2170,6 +2166,34 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
System.out.println("inside countOfListedUnlisted exception "+e); System.out.println("inside countOfListedUnlisted exception "+e);
e.printStackTrace(); e.printStackTrace();
} }
finally
{
try
{
if (conn != null)
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
conn = null;
}
}
catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in PlanVsActual.countOfListedUnlisted() " + d.getMessage());
throw new ITMException(d);
}
}
System.out.println("countOfListedUnlisted final json data "+visitObj); System.out.println("countOfListedUnlisted final json data "+visitObj);
return visitObj; return visitObj;
...@@ -2273,12 +2297,44 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S ...@@ -2273,12 +2297,44 @@ public JSONObject getTodaysCallsSummary(String dataSourceName,String loginCode,S
System.out.println("getTodaysCallData dcotor obj "+doctorObject); System.out.println("getTodaysCallData dcotor obj "+doctorObject);
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
System.out.println("inside getactivity type descr "+e); System.out.println("inside getactivity type descr "+e);
e.printStackTrace(); e.printStackTrace();
} }
finally
{
try
{
if (conn != null)
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
conn = null;
}
}
catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in PlanVsActual.getTodaysCallData() " + d.getMessage());
throw new ITMException(d);
}
}
System.out.println("getTodaysCallData doctor array "+doctorArray); System.out.println("getTodaysCallData doctor array "+doctorArray);
return doctorArray; return doctorArray;
......
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