String sql = "SELECT DISTRICT_ID,SCHOOL_ID FROM SCHOOL_DISTRICT WHERE DISTRICT_NO is not null and DISTRICT_NAME='"+districtName+"'";
return this.getJdbcTemplate().query(sql, new RowMapper() {
@Override
public Object mapRow(ResultSet rs, int arg1) throws SQLException {
int a=Integer.parseInt(rs.getString("DISTRICT_ID"));
SchoolDistrictDto schoolDistrictDto = new SchoolDistrictDto();
schoolDistrictDto.setDistrictId(Integer.parseInt(rs.getString("DISTRICT_ID")));
schoolDistrictDto.setSchoolId(rs.getString("SCHOOL_ID"));
return schoolDistrictDto;
}
});
你知道你这个代码写的有多乱吗???
还有你的结果集作为参数传入了mapRow函数,你的结果集哪里来的???