Thursday, March 12, 2009

Bank Account Manager

package manager;


import model.BankAccount;
import dataaccess.BankAccountDAO;

public class BankAccountMgr {
BankAccountDAO badao=(BankAccountDAO)new BankAccountDAO();
public BankAccount[] retrieveAcctType(String id)throws Exception
{
BankAccountDAO bDAO=new BankAccountDAO();
try{
bDAO.openConnection();
BankAccount[] result=bDAO.retrieveAccType(id);
return result;
}
catch(Exception e)
{
throw e;
}
finally
{
bDAO.closeConnection();
}
}
public boolean updatebalance(String custId,Integer fromaccId,Integer toaccId,Float tranamount,String accounttype)
throws Exception{
BankAccountDAO bDAO=new BankAccountDAO();
boolean b;
try{
bDAO.openConnection();
b=bDAO.updatebalance(custId,fromaccId,toaccId,tranamount,accounttype);
}catch(Exception e)
{
throw e;
}finally
{
bDAO.closeConnection();
}
return b ;
}

public int validateaccount (int accountno) throws Exception{
BankAccountDAO bDAO=new BankAccountDAO();
int result;
try{
bDAO.openConnection();
result = bDAO.validateaccount(accountno);
}
catch(Exception e)
{
throw e;
}finally
{
bDAO.closeConnection();
}
return result ;
}

}

No comments:

Post a Comment