Given this code for an entity bean:
private boolean insertAccount(String username, String password,
String lastname, boolean roles) {
try {
Connection con = makeConnection();
String sql = "Insert into tbl_Final(id, field1, field2, field3) "
+ "values(?, ?, ?, ?)";
PreparedStatement stm = con.prepareStatement(sql);
stm.setString(1, username);
stm.setString(2, password);
stm.setString(3, lastname);
stm.setBoolean(4, roles);
int rows = stm.executeUpdate();
stm.close();
con.close();
if (rows > 0) {
return true;
}
return false;
} catch (Exception e) {
throw new EJBException("Insert errors: " + e.getMessage());
}
}
Which statement is true?
Choose one answer.
a. The method should be put in the ejbStore method in BMP
b. The method should be put in the unsetEntity context method in BMP
c. The method should be put in the ejbPassivate method in BMP
d. The method should be put in the ejbCreate method in BMP