67,513
社区成员
发帖
与我相关
我的任务
分享
public List<Long> getxxxx(String no) {
String sql="select id from student where no=? ";
RowMapper rowMapper = new RowMapper() {
public Object mapRow(ResultSet rs, int index) throws SQLException {
StuBean stuBean=new StuBean();
stuBean.setId(rs.getLong("id"));
return stuBean.getId();
}
};
return getJdbcTemplate().query(sql,new Object[]{no},rowMapper);
}
class StuBean{
private Long id;
setter//
getter//
}