通过用户名找到所有订单(模式):执行一个sql语句
public List<OrderInfo> findAllByUserName(String username){
String sql="select * from orders where username=?";
List<OrderInfo> list=null;
DB db=new DB();
ResultSet rs=null;
try {
rs = db.query(sql, username);
list = rsToList(rs);
db.close(rs);
} catch (Exception e) {
e.printStackTrace();
}
return list;
}