{
if (systemEmailID <= 0)
{
// if the systemEmailID is not a positive, non-zero integer,
// then something is wrong, so throw an exception
throw new EJBException("System Email ID is required");
}
CVDal dbConn = new CVDal(this.dataSource);
HashMap emailInfoMap = new HashMap();
try
{
dbConn.setSql("system.email.getSystemEmailInfo");
dbConn.setInt(1, systemEmailID);
Collection sqlResults = dbConn.executeQuery();
if (sqlResults != null)
{
Iterator iter = sqlResults.iterator();
while (iter.hasNext())
{
emailInfoMap = (HashMap)iter.next();
break;
}
}
}catch(Exception e){
System.out.println("[Exception][EmailHelperEJB] Exception thrown in getSystemEmailInfo(): " + e);
e.printStackTrace(); // TODO: remove this stacktrace
throw new EJBException("Error while retrieving system email information from the database.");
}finally{
dbConn.clearParameters();
dbConn.destroy();
dbConn = null;
}