First page Back Continue Last page Graphics

...Continuation of Notes...


Notes:

//================================================
// Methods required by EntityBean interface
//================================================

public void ejbActivate() { } // Not used
public void ejbPassivate() { } // Not used

public void ejbLoad() throws EJBException {
try {
_iId = ((CustomerPK) _ctxt.getPrimaryKey()).id;
_psSelectID.setInt(1, iID);
ResultSet rs = _psSelectID.executeQuery();
rs.next();
_strLastName = rs.getString("lastname");
_strFirstName = rs.getString("firstname");
}
catch(SQLException se) {
throw new EJBException(se);
}
}

public void ejbStore() throws EJBException {
try {
_psUpdate.setString(1, _strLastName);
_psUpdate.setString(2, _strFirstName);
_psUpdate.setInt(3, _iId);
_psUpdate.executeUpdate();

}
catch(SQLException se) {
throw new EJBException(se);
}
}

public void ejbRemove() throws RemoveException {
try {
_psDelete.setInt(1, _iId);
_psDelete.executeUpdate();
}
catch(SQLException se) {
throw new RemoveException("Can't delete customer " +
se.getMessage());
}
}

// Continued...