Skip to content

Commit 013c894

Browse files
committed
Update JdbcTestUtils re: deprecated queryForInt()
JdbcTestUtils now invokes JdbcTemplate's queryForObject() method instead of the deprecated queryForInt() method. Issue: SPR-10257
1 parent c0e4387 commit 013c894

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-test/src/main/java/org/springframework/test/jdbc/JdbcTestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class JdbcTestUtils {
6161
* @return the number of rows in the table
6262
*/
6363
public static int countRowsInTable(JdbcTemplate jdbcTemplate, String tableName) {
64-
return jdbcTemplate.queryForObject("SELECT COUNT(0) FROM " + tableName, int.class);
64+
return jdbcTemplate.queryForObject("SELECT COUNT(0) FROM " + tableName, Integer.class);
6565
}
6666

6767
/**
@@ -83,7 +83,7 @@ public static int countRowsInTableWhere(JdbcTemplate jdbcTemplate, String tableN
8383
if (StringUtils.hasText(whereClause)) {
8484
sql += " WHERE " + whereClause;
8585
}
86-
return jdbcTemplate.queryForObject(sql, int.class);
86+
return jdbcTemplate.queryForObject(sql, Integer.class);
8787
}
8888

8989
/**

0 commit comments

Comments
 (0)