Transfer Funds

Transfer

TellerAccessor teller = new TellerAccessor(); int fromId = Integer.parseInt(request.getParameter("fromId")); int toId = Integer.parseInt(request.getParameter("toId")); double amount = new Double(request.getParameter("amount")).doubleValue(); try { teller.transfer(fromId, toId, amount); } catch (BankException ex) { out.println(ex.toString()); } Account fromAccount = teller.getAccount(fromId); Account toAccount = teller.getAccount(toId);

fromAccount

id=fromAccount.getId()

balance=fromAccount.getBalance()

toAccount

id=toAccount.getId()

balance=toAccount.getBalance()


home