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
...@@ -150,30 +150,38 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc ...@@ -150,30 +150,38 @@ public class GenerateReceiptPrc extends ProcessEJB implements GenerateReceiptPrc
String errString = ""; String errString = "";
String preview = ""; String preview = "";
try try
{ {
errString = getViewData(headerDom, detailDom, windowName, xtraParams); if(conn==null)
{
conn = getConnection();
}
errString = getViewData(headerDom, detailDom, windowName, xtraParams, conn);
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Exception :GenerateReceiptPrcEJB :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":"); System.out.println("Exception :GenerateReceiptPrcEJB :getData(String xmlString, String xmlString2, String windowName, String xtraParams):" + e.getMessage() + ":");
throw new ITMException(e); throw new ITMException(e);
} }
/*finally finally
{ {
try try
{ {
errString= null; conn.close();
conn = null;
} }
catch(Exception e) catch(Exception e)
{ {
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,e,true);
e.printStackTrace(); e.printStackTrace();
} }
}*/ }
return errString; 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 ...@@ -254,10 +262,10 @@ Put a validation chq amount in filter and total of details matches in case heade
try try
{ {
if(conn==null) /*if(conn==null)
{ {
conn = getConnection(); conn = getConnection();
} }*/
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat()); sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
DatabaseMetaData dbmd = conn.getMetaData(); DatabaseMetaData dbmd = conn.getMetaData();
...@@ -813,8 +821,8 @@ Put a validation chq amount in filter and total of details matches in case heade ...@@ -813,8 +821,8 @@ Put a validation chq amount in filter and total of details matches in case heade
{ {
retTabSepStrBuff = null; retTabSepStrBuff = null;
xmlBuff= null; xmlBuff= null;
conn.close(); //conn.close();
conn = null; //conn = null;
if(rs!=null) if(rs!=null)
rs.close(); rs.close();
if(pstmt!=null) if(pstmt!=null)
...@@ -1179,7 +1187,7 @@ conn = getConnection(); ...@@ -1179,7 +1187,7 @@ conn = getConnection();
System.out.println("objName....::- "+objName); System.out.println("objName....::- "+objName);
if("generate_receipt_process".equals(objName)) if("generate_receipt_process".equals(objName))
{ {
xmlString = getViewData(headerDom, detailDom, windowName, xtraParams); xmlString = getViewData(headerDom, detailDom, windowName, xtraParams, conn);
detailDom = genericUtility.parseString(xmlString); detailDom = genericUtility.parseString(xmlString);
parentNodeList = detailDom.getElementsByTagName("Detail2"); parentNodeList = detailDom.getElementsByTagName("Detail2");
} }
...@@ -1278,11 +1286,7 @@ conn = getConnection(); ...@@ -1278,11 +1286,7 @@ conn = getConnection();
System.out.println("TotalAdjAmt Inner Loop ["+totalAdjAmt+"]"); System.out.println("TotalAdjAmt Inner Loop ["+totalAdjAmt+"]");
}//inner for }//inner for
sql = "SELECT GROUP_CODE FROM CUSTOMER WHERE CUST_CODE = ?"; sql = "SELECT GROUP_CODE FROM CUSTOMER WHERE CUST_CODE = ?";
//Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true); //Commented by Manoj dtd 03/05/2014writeLog(filePtr,sql,true);
if(conn == null)
{
conn = getConnection();
}
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,custCode); pstmt.setString(1,custCode);
rs = pstmt.executeQuery(); 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