
Originally Posted by
dr_pompeii
Post both method implementations to get a better idea and see clearly each difference
but according to
since return a row with 1 column, and then I assume you could retrieve the value from the colum I could say the second approach is better since it return directly the value
Check the API documentation for more details for each method
As I said before the first implementation is:
Code:
public int someMethod(Object obj) {
jdbcOperations.queryForRowSet(sql, new Object[] {obj});
rs.next();
return rs.getInt(1);
}
The second implementation is:
Code:
public int someMethod(Object obj) {
return jdbcOperations.queryForInt(sql, new Object[] {obj});
}