新发现spring jdbc 2.5中有个BeanPropertyRowMapper,原来可以简单点,做记录和对象的映射,但前提

是你的POJO的属性跟记录集的声明是一样的,有点象APACHE的beanutils:

 

 

public

return getJdbcTemplate().query("select * from test", new BeanPropertyRowMapper(Test.class));   

  }