- 类图:认真分析模块,画好类图
- 连接MySQL数据库的时候犯的错误
- 导错了包
- Object[ ] parama = { };
- 返回单个对象时,不用集合,用对象接收返回的结果
3.用迭代器遍历集合时 ,创建新对象
/**
* 查看宠物商店的交易记录
*/
@Override
public void searchStoreAccount() {
// TODO Auto-generated method stub
List<Account> accountList = new ArrayList<Account>();
accountList=accountDaoImpl.getStoreAccount(psid);
Iterator<Account> iterator=accountList.iterator();
System.out.println("------店铺的交易记录如下------");
System.out.println("交易类型\t宠物编号\t价格");
while(iterator.hasNext()) {
Account account = new Account();
account=iterator.next();
System.out.println(
(account.getDeal_type()==1?"售卖宠物":"购买宠物")+"\t"+account.getPet_id()+"\t"+account.getPrice());
}
}
4.三目运算符的