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:
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.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.
If there is a cleaner way to get the same results, please let me know.
Thanks


Reply With Quote