Hi,
I would like to know which closing and which if statement is more advisable and why below mentioned conditions.
Condition1:
while(iterator.hasNext())
{
roDetailsVO = (RODetailsVO) iterator.next();
callableStatement = connection.prepareCall("{call testpac.test(?,?)}");
callableStatement.setInt(1, roDetailsVO.getInboxHdrId());
callableStatement.setInt(2, roDetailsVO.getUserId());
callableStatement.close();
}
OR
Condition2:
while(iterator.hasNext())
{
roDetailsVO = (RODetailsVO) iterator.next();
callableStatement = connection.prepareCall("{call testpac.test(?,?)}");
callableStatement.setInt(1, roDetailsVO.getInboxHdrId());
callableStatement.setInt(2, roDetailsVO.getUserId());
}
callableStatement.close(); // closing commonly
Condition 3
if(count==0)
System.out.println(“count value is zero ”);
Condition 4
if(count==0){
System.out.println(“count value is zero ”);
}
Kindly share some idea about this.
Thanks,