The Teller Class – Add
listAllAccounts()
public void
listAllCheckingAccounts() {
try {
PersistenceManager pManager = pmFactory_.getPersistenceManager();
Class pcClass =
Class.forName("com.hywy.samples.bank.Checking");
Extent extent =
pManager.getExtent(pcClass, false) ;
Iterator iterator =
extent.iterator();
while (iterator.hasNext())
{
Checking
checking = (PersistenceCapable)iterator.next();
Oid oid =
(Oid)pManager.getObjectId(checking);
System.out.println(“Checking Account Number:”+oid.toString());
}
} catch(Exception exception)
{
exception.printStackTrace();
}
}