First page Back Continue Last page Graphics
...Continuation of Notes...
Notes:
//================================================
// Methods for create(*) in home interface
//================================================
public CustomerPK ejbCreate() throws CreateException {
_strLastName = "";
_strFirstName = "";
return createCustomer(); // Throws CreateException if failure
}
public CustomerPK ejbCreate(String strLastName,
String strFirstName) throws CreateException {
_strLastName = strLastName;
_strFirstName = strFirstName;
return createCustomer(); // Throws CreateException if failure
}
public CustomerPK ejbFindByPrimaryKey(CustomerPK pk)
throws FinderException {
int iId = pk.id;
try {
_psSelectID.setInt(1, pk.id);
ResultSet rs = _psSelectID.executeQuery();
if(rs.next())
return pk;
else
throw new FinderException("Can't find customer" + iId);
}
catch(SQLException se) {
throw new FinderException("Can't find customer " +
iId + '\n' + se.getMessage());
}
}
// Continued...