The queryforInt/queryforLong methods in JdbcTemplate are deprecated in Spring 3.2. I can\'t find out why or what is considered the best practice to replace existing code using t
I agree with the original poster that deprecating the convenience method queryForLong(sql) is an inconvenience.
I had developed an app using Spring 3.1 and just updated to the latest Spring version (3.2.3) and noticed that it was deprecated.
Fortunately, it was a one line change for me:
return jdbcTemplate.queryForLong(sql); // deprecated in Spring 3.2.x
was changed to
return jdbcTemplate.queryForObject(sql, Long.class);
And a couple of Unit Tests seem to indicate, the above change works.