JdbcTemplate.queryForObject使用JPA查询返回字符串

public String getStatus(String tel){
    String sql =
            " SELECT status FROM cus_info WHERE telephone = ?;";
    return jdbcTemplate.queryForObject(sql,String.class, new Object[]{tel});
}
 
  
public Integer getStatus(String tel){
    String sql =
            " SELECT status FROM cus_info WHERE telephone = ?;";
    return jdbcTemplate.queryForObject(sql,Integer.class, new Object[]{tel});
}

你可能感兴趣的:(JdbcTemplate.queryForObject使用JPA查询返回字符串)