Dec 27, 2012

EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0

Hi,
Lately i had this exception in my spring jdbc part of code. What it
actually means is that your query probably doesn't return any value while you are trying to assign the query result into let's say 'int'.

Change the query from queryForInt to regular query that returns a list. Use row mapper also.
Check the list, if it's empty, nothing returned from the query, decide what to do, else if the list isn't empty
and contain data, also, decide what to do.
It then will work for you.



Hoped i helped,
Dor