日期:2014-05-18 浏览次数:20744 次
final String sql="SELECT * FROM TB_PROJECT_SHEET " ;
String idS="'4028819e442b295501442b2bfd550002','4028819e442decc801442df4ef3f0004'" ;
//1. 以Spring JDBC的方式
List<Projects> list=(List<Projects>) jdbcTemplate.queryForObject(sql,new RowMapper(){
@Override
public Object mapRow(ResultSet rs, int i) throws SQLException {
List<Projects> list=new ArrayList<Projects>() ;
while(rs.next()){
Projects project=new Projects() ;
project.setId(rs.getString("id")) ;
project.setProjName(rs.getString("projname")) ;
list.add(project) ;
}
return list;
}
}) ;