Replace deprecated method queryForInt with queryForObject.