Commit 66848094 authored by manohar's avatar manohar

closing of statement and result set done


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91362 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 46c07429
......@@ -36,16 +36,12 @@ import javax.ejb.Stateless; // added for ejb3
public class BOMAct extends ActionHandlerEJB implements BOMActLocal , BOMActRemote //SessionBean
{
GenericUtility genericUtility = null;
ConnDriver connDriver = new ConnDriver();
Connection conn = null;
PreparedStatement pstmt = null;
@PostConstruct
/*@PostConstruct
public void ejbCreate() //throws RemoteException//, CreateException
{
System.out.println("Create Method Called[BOMActEJB].................");
try
{
conn = connDriver.getConnectDB("DriverITM");
}
catch(Exception e)
{
......@@ -54,7 +50,7 @@ public class BOMAct extends ActionHandlerEJB implements BOMActLocal , BOMActRem
}
}
/*public void ejbRemove()
public void ejbRemove()
{
}
......@@ -170,6 +166,8 @@ public String actionHandler(String actionType, String xmlString,String xmlString
private String actionViewAltBOM(Document dom,Document dom1, String objContext, String xtraParams) throws RemoteException , ITMException
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = null;
StringBuffer valueXmlString = new StringBuffer("<?xml version=\"1.0\"?>\r\n<Root>\r\n");
......@@ -178,10 +176,13 @@ public String actionHandler(String actionType, String xmlString,String xmlString
try
{
ConnDriver connDriver = new ConnDriver();
if(conn==null)
{
conn = connDriver.getConnectDB("DriverITM");
}
connDriver = null;
bomCode = genericUtility.getColumnValue("bom_code",dom1);
if(bomCode!=null)
......@@ -206,6 +207,10 @@ public String actionHandler(String actionType, String xmlString,String xmlString
valueXmlString.append("<item_code_alt_seq>").append("<![CDATA[").append(rs.getString(5).trim()).append("]]>").append("</item_code_alt_seq>\r\n");
valueXmlString.append("</Detail>\r\n");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
valueXmlString.append("</Root>\r\n");
}
......@@ -225,9 +230,16 @@ public String actionHandler(String actionType, String xmlString,String xmlString
finally
{
try{
if (conn != null)
{
conn.close();
conn = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}catch(Exception e){}
}
//stem.out.println("valueXmlString.toString() "+valueXmlString.toString());
......@@ -237,6 +249,8 @@ public String actionHandler(String actionType, String xmlString,String xmlString
{
//atement stmt = null;
ResultSet rs = null;
Connection conn = null;
PreparedStatement pstmt = null;
String sql = null;
String bomCode=null;
......@@ -261,6 +275,7 @@ public String actionHandler(String actionType, String xmlString,String xmlString
{
conn = connDriver.getConnectDB("DriverITM");
}
connDriver = null;
bomCode = genericUtility.getColumnValue("bom_code",dom);
System.out.println("bomCode From Dom::::::"+bomCode);
......@@ -362,7 +377,8 @@ public String actionHandler(String actionType, String xmlString,String xmlString
valueXmlString.append("<stock>").append("<![CDATA[").append(rs1.getDouble(1)).append("]]>").append("</stock>\r\n");
valueXmlString.append("<allock_qty>").append("<![CDATA[").append(rs1.getString(2).trim()).append("]]>").append("</allock_qty>\r\n");
}
rs1.close();
rs1 = null;
valueXmlString.append("</Detail>\r\n");
}
......@@ -386,9 +402,16 @@ public String actionHandler(String actionType, String xmlString,String xmlString
finally
{
try{
if (conn != null)
{
conn.close();
conn = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}catch(Exception e){}
}
System.out.println("valueXmlString.toString() "+valueXmlString.toString());
......
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