Commit a12873ce authored by prane's avatar prane

chnaged the connection for getdata()method

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190206 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1efa1c0c
......@@ -151,29 +151,37 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
String preview = "";
try
{
errString = getViewData(headerDom, detailDom, windowName, xtraParams);
if(conn==null)
{
conn = getConnection();
}
errString = getViewData(headerDom, detailDom, windowName, xtraParams, conn);
}
catch (Exception e)
{
System.out.println("Exception :GenerateReceiptPrcEJB :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
throw new ITMException(e);
}
/*finally
finally
{
try
{
errString= null;
conn.close();
conn = null;
}
catch(Exception e)
{
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
e.printStackTrace();
}
}*/
}
return errString;
}
private String getViewData(Document headerDom, Document detailDom, String windowName, String xtraParams) throws RemoteException,ITMException
private String getViewData(Document headerDom, Document detailDom, String windowName, String xtraParams, Connection conn) throws RemoteException,ITMException
{
/*
......@@ -254,10 +262,10 @@ Put a validation chq amount in filter and total of details matches in case heade
try
{
if(conn==null)
/*if(conn==null)
{
conn = getConnection();
}
}*/
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
DatabaseMetaData dbmd = conn.getMetaData();
......@@ -813,8 +821,8 @@ Put a validation chq amount in filter and total of details matches in case heade
{
retTabSepStrBuff = null;
xmlBuff= null;
conn.close();
conn = null;
//conn.close();
//conn = null;
if(rs!=null)
rs.close();
if(pstmt!=null)
......@@ -1179,7 +1187,7 @@ conn = getConnection();
System.out.println("objName....::- "+objName);
if("generate_receipt_process".equals(objName))
{
xmlString = getViewData(headerDom, detailDom, windowName, xtraParams);
xmlString = getViewData(headerDom, detailDom, windowName, xtraParams, conn);
detailDom = genericUtility.parseString(xmlString);
parentNodeList = detailDom.getElementsByTagName("Detail2");
}
......@@ -1279,10 +1287,6 @@ conn = getConnection();
}//inner for
sql = "SELECT GROUP_CODE FROM CUSTOMER WHERE CUST_CODE = ?";
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
if(conn == null)
{
conn = getConnection();
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode);
rs = pstmt.executeQuery();
......
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