errMsg);
throw new I2sRepositoryException(errMsg);
}
// Get a configured Name object out of AppConfig.
Name name = new Name();
try {
name = (Name)getAppConfig().getObject("Name");
}
catch (EnterpriseConfigurationObjectException eoce) {
// An error occurred retrieving a Name object from AppConfig. Log it and
// throw an exception.
String errMsg = "An error occurred retrieving a Name object from " +
"AppConfig. The exception is: " + eoce.getMessage();
logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdBySsn] " +
errMsg);
throw new I2sRepositoryException(errMsg);
}
// Initialize a query string to retrieve the InstitutionalIdentity.
String getString1 = "SELECT INST_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, " +
"SSN, BIRTH_DATE, GENDER FROM T_INST_IDENT WHERE SSN = ? AND " +
"TERMINATED_DATE IS NULL";
try {
PreparedStatement getStmt1 = conn.prepareStatement(getString1);
getStmt1.clearParameters();
getStmt1.setString(1, ssn);
ResultSet r1 = getStmt1.executeQuery();
if (r1.next()) {
// The InstitutionalIdentity exists. Log a message and build the
// InstitutionalIdentity object.
logger.debug("[RdbmsI2sRepository.retrieveInstitutionalIdentityBySsn] "
+ "Found an InstitutionalIdentity in the database for SSN: " + ssn +
".");
// Set the values of the Name object.
try {
name.setFirstName(r1.getString(2));
name.setMiddleName(r1.getString(3));
name.setLastName(r1.getString(4));
}
catch (EnterpriseFieldException efe) {
// An error occurred setting field values for the Name. Log it,
// close the statement, and throw an exception.
String errMsg = "An error occurred seeting field values for the " +