* Insert a person
*/
private int insertEmployeeSampleRecord(Connection conn, String salutation,
String firstName, String lastName, String gender, int depID) {
// Insert an Employee
DBRecord rec = new DBRecord();
rec.create(sampleDB.T_EMPLOYEES);
rec.setValue(sampleDB.T_EMPLOYEES.SALUTATION, salutation);
rec.setValue(sampleDB.T_EMPLOYEES.FIRST_NAME, firstName);
rec.setValue(sampleDB.T_EMPLOYEES.LAST_NAME, lastName);
rec.setValue(sampleDB.T_EMPLOYEES.GENDER, gender);
rec.setValue(sampleDB.T_EMPLOYEES.DEPARTMENT_ID, depID);
try {
rec.update(conn);
} catch (Exception e) {
log.error(e.getLocalizedMessage());
return 0;
}
// Return Employee ID
return rec.getInt(sampleDB.T_EMPLOYEES.EMPLOYEE_ID);
}