n // Create the
required DAO Factory and the DAO
Object
n
DAOFactory cloudscapeFactory =
n
DAOFactory.getDAOFactory(DAOFactory.DAOCLOUDSCAPE);
n
CustomerDAO custDAO = cloudscapeFactory.getCustomerDAO();
n // Create a new customer. Find a customer object. Get Transfer
Object.
n int newCustNo =
custDAO.insertCustomer(...);
n Customer cust = custDAO.findCustomer(...);
n // modify the values in the
Transfer Object. Update the
customer object
n cust.setAddress(...); cust.setEmail(...);
custDAO.updateCustomer(cust);
n // delete a customer object
n
custDAO.deleteCustomer(...);
n // select all customers in the same city
n
Customer criteria=new Customer(); criteria.setCity("New
York");
n Collection customersList =
custDAO.selectCustomersTO(criteria);
n // returns collection of CustomerTOs.
iterate through this collection to get values.
n ...