public List<User> findAll() { private JdbcTemplate template = new JdbcTemplate(JdbcUtils.getDataSourse()); //使用jdbc操做數據庫 //1.定義sql語句 String sql = "select * from user"; //2.執行sql語句 List<User> users = template.query(sql, new BeanPropertyRowMapper<User>(User.class)); return users; }