Commit a056cd1a authored by manohar's avatar manohar

unclosed connections closed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91081 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 3004bdfa
......@@ -172,11 +172,13 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
Statement stmt = null;
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
//GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
itemCode = genericUtility.getColumnValue("item_code",dom);
locCode = genericUtility.getColumnValue("loc_code",dom);
......@@ -315,14 +317,16 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
ConnDriver connDriver = new ConnDriver();
double ordQty = 0,pickQty = 0,integralQty = 0, stkQty = 0, remainingQty = 0;
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
//GenericUtility genericUtility = GenericUtility.getInstance(); //ADDED BY ALKA ON 24/07/07
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB(); //ADDED BY ALKA ON 24/07/07
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
if (qtyStr.equals("0"))
{
......@@ -502,7 +506,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
boolean flag = true;
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
//GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
/* String grossWeight = "";
String tareWeight = "";
......@@ -514,7 +518,9 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
//detailCnt = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"detCnt");
if(detailCnt.equals("0"))
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
distOrder = genericUtility.getColumnValue("dist_order",dom1);
System.out.println("distOrder :"+distOrder);
......@@ -765,7 +771,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
//changed by msalam on 22/09/07 and declared as class level
//GenericUtility genericUtility = GenericUtility.getInstance();
String tranTypeParent = null;
ConnDriver connDriver = new ConnDriver();
ITMDBAccessEJB itmDBAccess = new ITMDBAccessEJB();
try
......@@ -773,7 +779,9 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
//detailCnt = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"detCnt");
if(detailCnt.equals("0"))
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
stmt1 = conn.createStatement();
stmt2 = conn.createStatement();
......@@ -897,6 +905,8 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
checkIntegralQty = "Y";
}
}
rs.close();
rs = null;
}
else
{
......@@ -1887,7 +1897,34 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
//System.out.println("Excepton occurs in DistIssueAct Allocate :: " +e);
e.printStackTrace();
}
System.out.println("valueXmlString from DistIssueAct Allocate ::"+valueXmlString);
finally
{
try
{
if( rs != null )
{
rs.close();
rs = null;
}
if (stmt != null)
{
stmt.close();
stmt = null;
}
if(conn != null)
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
System.out.println("Error In closing connection::==> "+e);
e.printStackTrace();
}
}
//System.out.println("valueXmlString from DistIssueAct Allocate ::"+valueXmlString);
return valueXmlString.toString();
}
......@@ -1905,7 +1942,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
PreparedStatement pstmt = null; //added by Jiten on 20/03/06 for change in sql
Document dom = null, dom1 = null, domItmChng = null;
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
Node parentNode = null, parentNode1 = null, childNode = null , childNode1 = null;
NodeList parentNodeList = null, childNodeList = null, parentNodeList1 = null, childNodeList1 = null;
int parentNodeListLen = 0, childNodeListLen = 0, parentNodeListLen1 = 0, childNodeListLen1 = 0;
......@@ -1947,7 +1984,9 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
System.out.println("The xmlString1 found null");
}
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
//distOrder = genericUtility.getColumnValue("dist_order",dom1);
//COMMENTED ABOVE AND ADDED BELOW LINE FOR REQ ID DI89MAN022 //mukesh 24 sept 08
......@@ -2249,8 +2288,11 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
try
{
conn.close();
conn = null;
if (conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e){}
}
......@@ -2295,7 +2337,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
type = priceListType(priceList);
System.out.println("type :"+type);
ArrayList returnList = null;
ConnDriver connDriver = new ConnDriver(); //Gulzar 01/03/07
try
{
returnList = genericUtility.getTokenList(lotNo,"\t");
......@@ -2321,12 +2363,15 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
lotSL = returnList.get(3).toString();
}
}
ConnDriver connDriver = new ConnDriver(); //Gulzar 01/03/07
switch (type)
{
case 'L' : //List Price
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = ? "
+"AND ITEM_CODE = ? AND LIST_TYPE = 'L' "
+"AND EFF_FROM <= ? AND VALID_UPTO >= ?";
......@@ -2406,6 +2451,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = ? "
+"AND ITEM_CODE = ? AND LIST_TYPE = 'F' "
+"AND EFF_FROM <= ? AND VALID_UPTO >= ? ";
......@@ -2483,6 +2529,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = ? "
+"AND ITEM_CODE = ? AND LIST_TYPE = 'L' "
+"AND EFF_FROM <= ? AND VALID_UPTO >= ?";
......@@ -2625,6 +2672,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
rate = 0;
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = ? "
+"AND ITEM_CODE = ? AND LIST_TYPE = 'B' "
......@@ -2715,6 +2763,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
rate = 0;
sql = "SELECT RATE FROM PRICELIST WHERE PRICE_LIST = ? "
......@@ -2798,6 +2847,7 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
try
{
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
rate = 0;
if (lotSL.equals("") || lotSL.trim().length() > 0)
{
......@@ -2846,13 +2896,18 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
System.out.println("The sql Exception occurs :"+e);
}
finally
finally
{
try
{
try
if (conn != null)
{
conn.close();
}catch(Exception e){}
conn = null;
}
}
catch (Exception e){}
}
}//end switch
System.out.println("rate :"+rate);
return rate;
......@@ -2866,10 +2921,12 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
ResultSet rs = null;
Connection conn = null;
Statement stmt = null;
ConnDriver connDriver = new ConnDriver();
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
sql = "SELECT LIST_TYPE FROM PRICELIST WHERE PRICE_LIST = '"+priceList+"'";
System.out.println("sql :"+sql);
......@@ -2900,14 +2957,18 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
System.out.println("The Exception Occures in priceListType :"+e);
}
finally
finally
{
try
{
conn.close();
stmt = null;
}catch(Exception e){}
}// finally end
if (conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e){}
}
System.out.println("listType :"+listType);
return listType;
}
......@@ -2954,11 +3015,13 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
String sql = "";
ResultSet rs = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
Statement stmt = null;
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
sql ="SELECT CASE WHEN SHIPPER_SIZE IS NULL THEN 0 ELSE SHIPPER_SIZE END "
+"FROM ITEM_LOT_PACKSIZE "
......@@ -3012,6 +3075,18 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
System.out.println("the exception occurs in getIntegralQty :"+e);
}
finally
{
try
{
if (conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e){}
}
System.out.println("integralQty :"+integralQty);
return integralQty;
}
......@@ -3021,13 +3096,15 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
String sql = "";
ResultSet rs = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
Statement stmt = null;
double reoQty = 0d, capacity = 0d, integralQty = 0d, mod = 0d, noArt3 = 0d;
double noArt = 0, noArt1 = 0, noArt2 = 0;
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
stmt = conn.createStatement();
System.out.println("type :"+type);
switch (type)
......@@ -3240,6 +3317,18 @@ public class DistIssueAct extends ActionHandlerEJB implements DistIssueActLocal,
{
System.out.println("Exception occures in getNoArt :"+e);
}
finally
{
try
{
if (conn != null)
{
conn.close();
conn = null;
}
}
catch (Exception e){}
}
System.out.println("(int)noArt :"+(int)noArt);
return (int)noArt;
}
......
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