Example usage for org.springframework.dao EmptyResultDataAccessException toString

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

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:wherehows.dao.table.DatasetsDao.java

/**
 * get WhereHows dataset id by dataset URN
 * @param jdbcTemplate JdbcTemplate//from w  w  w  . jav  a2  s  . c  o m
 * @param urn String
 * @return dataset ID, if not found, return -1
 */
public int getDatasetIdByUrn(JdbcTemplate jdbcTemplate, String urn) {
    try {
        return jdbcTemplate.queryForObject(GET_DATASET_ID_BY_URN, Integer.class, urn);
    } catch (EmptyResultDataAccessException e) {
        log.debug("Can not find dataset id for urn: " + urn + " : " + e.toString());
    }
    return -1;
}