Results 1 to 3 of 3

Thread: IncorrectResultSizeDataAccessException?

  1. #1
    Join Date
    Oct 2004
    Posts
    9

    Default IncorrectResultSizeDataAccessException?

    I have a DAO that needs to query a table for a row which may or may not be there. I was attempting to use the JdbcTemplate.queryForObject, returning the String of the column I selected. After looking at the JavaDoc, my intent was to catch the IncorrectResultSizeDataAccessException, whose javadoc states:

    Data access exception thrown when a result was not of the expected size, for example when expecting a single row but getting 0 or more than 1 rows.
    The thing is, I can't find this class anywhere in the jars I have, and when running the method, I get the superclass InvalidDataAccessApiUsageException. I'm hesitant to assume no records were found on this exception since the javadoc seems to indicate the problem may not be that specific.

    If there is a cleaner way to get the same results, please let me know.

    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    1,110

    Default

    It has been there since 1.0.2 - full name is:
    org.springframework.dao.IncorrectResultSizeDataAcc essException
    and it does extend the InvalidDataAccessApiUsageException
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  3. #3
    Join Date
    Oct 2004
    Posts
    9

    Default

    Oops. I was wrong on the version of Spring I am using. I'm on 1.0.1. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •