Update JdbcTestUtils re: deprecated queryForInt()

JdbcTestUtils now invokes JdbcTemplate's queryForObject() method instead
of the deprecated queryForInt() method.

Issue: SPR-10257
This commit is contained in:
Sam Brannen 2013-02-28 01:56:13 +01:00
parent c0e4387cbc
commit 013c894c25
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class JdbcTestUtils {
* @return the number of rows in the table * @return the number of rows in the table
*/ */
public static int countRowsInTable(JdbcTemplate jdbcTemplate, String tableName) { public static int countRowsInTable(JdbcTemplate jdbcTemplate, String tableName) {
return jdbcTemplate.queryForObject("SELECT COUNT(0) FROM " + tableName, int.class); return jdbcTemplate.queryForObject("SELECT COUNT(0) FROM " + tableName, Integer.class);
} }
/** /**
@ -83,7 +83,7 @@ public class JdbcTestUtils {
if (StringUtils.hasText(whereClause)) { if (StringUtils.hasText(whereClause)) {
sql += " WHERE " + whereClause; sql += " WHERE " + whereClause;
} }
return jdbcTemplate.queryForObject(sql, int.class); return jdbcTemplate.queryForObject(sql, Integer.class);
} }
/** /**