You can use jdcb.queryForObject, then catch IncorrectResultSizeDataAccessException and use it's method getActualSize to determine if resource not exists or there is some consistency error (in case size > 1).