Example usage for org.springframework.dao EmptyResultDataAccessException printStackTrace

List of usage examples for org.springframework.dao EmptyResultDataAccessException printStackTrace

Introduction

In this page you can find the example usage for org.springframework.dao EmptyResultDataAccessException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.ccoe.build.service.config.ConfigurationJDBCTemplate.java

public Configuration getConfiguration(String appName) {
    String SQL = "select switch, contacts, site from rbt_build_service_config " + "where app_name = ?";
    try {/*w ww. ja v a  2 s . c  o m*/
        Configuration conf = jdbcTemplateObject.queryForObject(SQL, new Object[] { appName },
                new ConfigurationMapper());
        return conf;
    } catch (EmptyResultDataAccessException e) {
        e.printStackTrace();
    }
    return null;
}

From source file:com.pactera.edg.am.metamanager.extractor.dao.impl.MetaModelDaoImpl.java

/**
 * SQL?//from  www.j a  va  2s.c  o  m
 */
public void genStorePosition(MetaModel metaModel) {
    String sql = super.getSql("METAMODEL_ATTR_STORE");

    try {
        getJdbcTemplate().queryForObject(sql, new Object[] { metaModel.getName() },
                new MetaModelMapper(metaModel.getAttrs()));
    } catch (EmptyResultDataAccessException e) {
        e.printStackTrace();
    }
}

From source file:org.jasig.portlet.degreeprogress.mvc.portlet.DegreeProgressController.java

@RequestMapping(params = "action=showWhatIf")
public ModelAndView showWhatIfProgress(PortletRequest request,
        @ModelAttribute("whatIfForm") WhatIfRequest whatIfRequest) {
    Map<String, Object> model = new HashMap<String, Object>();
    String err;/*w w w.  j ava 2  s  .co m*/
    try {

        DegreeProgressReport report = degreeProgressDao.getWhatIfReport(whatIfRequest);
        model.put("report", report);

        DegreeProgramSummary summary = new DegreeProgramSummary();

        List<ProgramComponent> programs = degreeProgramDao.getPrograms(whatIfRequest.getEntryTerm());
        for (ProgramComponent program : programs) {
            if (program.getKey().equals(whatIfRequest.getProgram())) {
                summary.setProgram(program.getName());
                break;
            }
        }

        List<ProgramComponent> majors = degreeProgramDao.getMajors(whatIfRequest.getProgram());
        for (ProgramComponent major : majors) {
            if (major.getKey().equals(whatIfRequest.getMajor())) {
                summary.getMajors().add(major);
                break;
            }
        }

        if (StringUtils.isNotBlank(whatIfRequest.getMajor2())) {
            for (ProgramComponent major : majors) {
                if (major.getKey().equals(whatIfRequest.getMajor2())) {
                    summary.getMajors().add(major);
                    break;
                }
            }
        }

        List<ProgramComponent> minors = degreeProgramDao.getMinors();
        if (StringUtils.isNotBlank(whatIfRequest.getMinor())) {
            for (ProgramComponent minor : minors) {
                if (minor.getKey().equals(whatIfRequest.getMinor())) {
                    summary.getMinors().add(minor);
                    break;
                }
            }
        }

        if (StringUtils.isNotBlank(whatIfRequest.getMinor2())) {
            for (ProgramComponent minor : minors) {
                if (minor.getKey().equals(whatIfRequest.getMinor2())) {
                    summary.getMinors().add(minor);
                    break;
                }
            }
        }

        List<ProgramComponent> concentrations = degreeProgramDao.getConcentrations();
        if (StringUtils.isNotBlank(whatIfRequest.getConcentration())) {
            for (ProgramComponent concentration : concentrations) {
                if (concentration.getKey().equals(whatIfRequest.getConcentration())) {
                    summary.getConcentrations().add(concentration);
                    break;
                }
            }
        }

        if (StringUtils.isNotBlank(whatIfRequest.getConcentration2())) {
            for (ProgramComponent concentration : concentrations) {
                if (concentration.getKey().equals(whatIfRequest.getConcentration2())) {
                    summary.getConcentrations().add(concentration);
                    break;
                }
            }
        }

        model.put("program", summary);

        return new ModelAndView("degreeProgress", model);

    } catch (EmptyResultDataAccessException e) {
        //No goremal record found
        System.out.print(e);

        err = "Your Banner record is not complete at this time please try again later.";
        model.put("err", err);

        return new ModelAndView("error", model);

    } catch (UncategorizedSQLException e) {
        //This is for sgastdn no record found
        System.out.print(e);

        err = "You are not a student and cannot run this portlet.";
        model.put("err", err);

        return new ModelAndView("error", model);

    } catch (Exception e) {
        System.out.print(e);
        e.printStackTrace();

        err = "General Error\nPlease check the log.";
        model.put("err", err);

        return new ModelAndView("error", model);

    }
}

From source file:org.wise.portal.dao.user.impl.HibernateUserDao.java

/**
 * Given a reset password key retrieve a corresponding user.
 * @param resetPasswordKey an alphanumeric key
 * @return a User object or null if there is no user with the given reset password key
 *///ww  w .ja v  a  2  s.  com
@Override
public User retrieveByResetPasswordKey(String resetPasswordKey) {
    User user = null;
    try {
        user = (User) DataAccessUtils.requiredUniqueResult(this.getHibernateTemplate().findByNamedParam(
                "from UserImpl as user where user.userDetails.resetPasswordKey = :resetPasswordKey",
                "resetPasswordKey", resetPasswordKey));
    } catch (EmptyResultDataAccessException e) {
        e.printStackTrace();
    }

    return user;
}