everyone. I have a rookie question about the returning value in java. Here\'s my code.
@Override
public long addDrugTreatment(long id, String diagnosis, Stri
Let's imagine a JMSException was thrown:
@Override
public long addDrugTreatment(long id, String diagnosis, String drug,
float dosage) throws PatientNotFoundExn {
try {
Patient patient = patientDAO.getPatientByDbId(id);
long tid = patient.addDrugTreatment(diagnosis, drug, dosage);
Connection treatmentConn = treatmentConnFactory.createConnection();
//JMS thrown above. No code from here gets executed
} catch (PatientExn e) {
throw new PatientNotFoundExn(e.toString());
} catch (JMSException e) {
logger.severe("JMS Error: " + e);
}
}
In the above if a JMSException is thrown no part of the code returns a long.