JdbcTemplate查询结果封装成对象
代码示例
//引入
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.RowMapper;
....
//使用
RowMapper<TDistCity > rm = BeanPropertyRowMapper.newInstance(TDistCity.class);
String citysql = "select * from t_dist_city where pk_userid=1";
List<TDistCity> listcity = dbJdbcTemplate.query(citysql,rm);