Commit c6ccd9d8 authored by pborate's avatar pborate

Updated changes for connection close

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@198023 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dd3c4f31
......@@ -419,40 +419,68 @@ public class DWHCompleteEJB extends ValidatorEJB
.append(" A.PTS,")
.append(" A.TRAN_ID,")
.append(" A.HSN_CODE,A.PACK, A.DUE_DATE,DC.CITY ,A.ITEM_BRAND, A.IGST_RATE ");
System.out.println("sql in dwh complete ejb "+sql);
System.out.println("sql in dwh complete ejb::::::::::::::: "+sql);
pstmt = userDbConn.prepareStatement(sql.toString());
rs = pstmt.executeQuery();
pstmt.close();
rs.close();
pstmt = null;
rs = null;
updateSql.append("UPDATE DWH_TRAN_LOAD SET UPDATE_STAT='C'")
.append("WHERE REF_ID='"+refId+"' AND REF_SER='"+refSer+"' AND REF_DATE='"+refDate+"'");
System.out.println("sql in dwh complete updateSql "+updateSql);
System.out.println("sql in dwh complete updateSql:::::: >>"+updateSql);
pstmt = userDbConn.prepareStatement(updateSql.toString());
rs = pstmt.executeQuery();
throw new Exception();
pstmt.close();
rs.close();
pstmt = null;
rs = null;
// throw new Exception();
}
catch (SQLException e) {
// TODO Auto-generated catch block
System.err.println("An exception was SQLException :::::"+ e);
System.out.println("An exception was SQLException :::::"+ e +pstmt +rs);
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if ( rs != null )
{
rs.close();
rs = null;
}
}
catch(Exception ex) {
System.err.println("An exception was Exception :::::"+ ex);
System.out.println("An exception was Exception :::::"+ ex +pstmt +rs);
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if ( rs != null )
{
rs.close();
rs = null;
}
}
System.out.println("count :::::::::"+i);
}
System.out.println("END :::::::::::::");
userDbConn.commit();
userDbConn.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
System.out.println("An exception SQLException :::::"+ e);
e.printStackTrace();
}
catch (Exception ex) {
// TODO Auto-generated catch block
System.err.println("An exception was thrown"+ex);
System.out.println("An exception was thrown"+ex);
}
finally
......@@ -538,7 +566,10 @@ public class DWHCompleteEJB extends ValidatorEJB
}
transDataArray= tempArray;
System.out.println("Inside transDataArray after ::::"+transDataArray);
pstmt.close();
rs.close();
pstmt = null;
rs = null;
} catch (SQLException e) {
// TODO Auto-generated catch block
......@@ -603,9 +634,15 @@ public class DWHCompleteEJB extends ValidatorEJB
System.out.println("delete sql ::::: "+deleteSql);
pstmt = conn.prepareStatement(deleteSql.toString());
rs = pstmt.executeQuery();
pstmt.close();
rs.close();
pstmt = null;
rs = null;
}
conn.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
......
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