class AutonomiccsSystemVmTemplateJdbcDao extends JdbcDaoSupport {

    protected boolean executeTemplateQueryAndRetrieveBoolean(String templateName, String sql) {
        Integer numberOfRegister = getJdbcTemplate().queryForObject(sql, new Object[] {templateName}, Integer.class);
        if (numberOfRegister > 1) {
            throw new CloudRuntimeException(String.format("More than one template with name [%s]", templateName));
        }
        return BooleanUtils.toBoolean(numberOfRegister);
    }

}