第四步:创建持久化层ProductDAO
public List<Product> findAll() throws SQLException{
QueryRunner runner = new QueryRunner(JdbcUtils.getDataSource());
return runner.query(“select * from product”,new BeanListHandler<Product>(Product.class));
}
public List<Product> findAll() throws SQLException{
QueryRunner runner = new QueryRunner(JdbcUtils.getDataSource());
return runner.query(“select * from product”,new BeanListHandler<Product>(Product.class));
}