public List listAll() throws Exception {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
List all = new ArrayList(); try {
conn = DBConnection.getConnection();
String sql = "select * from [user]";
ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
while (rs.next()) {
User user = new User();
user.setId(rs.getInt("id"));
user.setName(rs.getString("name"));
user.setPassword(rs.getString("password"));
user.setEmail(rs.getString("email"));
user.setAge(rs.getInt("age"));
user.setBirthday(rs.getDate("birthday"));
user.setMoney(rs.getFloat("money"));
list.add(all);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
DBConnection.close(rs, ps, conn);
}
return all;
}
为什么编译通过不了?应该怎样改啊?主要是这三句话 List all = new ArrayList();  list.add(all); return all;