Commit 4dd449ad authored by Ketan Patil's avatar Ketan Patil

Replace UnallocatedMrketingDoc.java

parent 52708b74
......@@ -25,24 +25,28 @@ public class UnallocatedMrketingDoc implements UnallocatedMrketingDocRemote, Una
String strGetObj = "select obj_name from unallocated_attach WHERE STATUS='N' AND upper(obj_name) = 'MARKETING_BILL' group by obj_name";
String objName = "";
Connection conn = null;
PreparedStatement pstmtParamName=null;
PreparedStatement pstmtParamName2=null;
ResultSet rsCnt2=null;
ResultSet rsCnt =null;
try {
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
ArrayList docIds = new ArrayList();
PreparedStatement pstmtParamName = conn.prepareStatement(
pstmtParamName = conn.prepareStatement(
"select obj_name from unallocated_attach WHERE STATUS='N' AND upper(obj_name) = 'MARKETING_BILL' group by obj_name");
ResultSet rsCnt = pstmtParamName.executeQuery();
rsCnt = pstmtParamName.executeQuery();
String unallocDocIds;
while (rsCnt.next()) {
System.out.println("obj name = " + rsCnt.getString(1));
objName = rsCnt.getString(1);
unallocDocIds = "select doc_id from UNALLOCATED_ATTACH where STATUS='N' and OBJ_NAME =? order by Added_on , ref_id";
PreparedStatement pstmtParamName2 = conn.prepareStatement(
pstmtParamName2 = conn.prepareStatement(
"select doc_id from UNALLOCATED_ATTACH where STATUS='N' and OBJ_NAME =? order by Added_on , ref_id");
pstmtParamName2.setString(1, rsCnt.getString(1));
ResultSet rsCnt2 = pstmtParamName2.executeQuery();
rsCnt2 = pstmtParamName2.executeQuery();
while (rsCnt2.next()) {
docIds.add(rsCnt2.getString(1));
......@@ -55,6 +59,13 @@ public class UnallocatedMrketingDoc implements UnallocatedMrketingDocRemote, Una
pstmtParamName = null;
rsCnt.close();
rsCnt = null;
//added by sangita 21-4-23
pstmtParamName2.close();
pstmtParamName2 = null;
rsCnt2.close();
rsCnt2 = null;
//added by sangita 21-4-23
if (docIds != null && !docIds.isEmpty()) {
unallocDocIds = "";
......@@ -89,7 +100,36 @@ public class UnallocatedMrketingDoc implements UnallocatedMrketingDocRemote, Una
var25.printStackTrace();
} finally {
try {
if (conn != null) {
if(rsCnt2 !=null)
{
rsCnt2.close();
rsCnt2 = null;
}
if(rsCnt !=null)
{
rsCnt.close();
rsCnt = null;
}
if(pstmtParamName !=null)
{
pstmtParamName.close();
pstmtParamName = null;
}
if(pstmtParamName2 !=null)
{
pstmtParamName2.close();
pstmtParamName2 = null;
}
conn.close();
}
......
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