* Insert a department
*/
private int insertDepartmentSampleRecord(Connection conn, String department_name, String businessUnit)
{
// Insert a Department
DBRecord rec = new DBRecord();
rec.create(db.DEPARTMENTS);
rec.setValue(db.DEPARTMENTS.NAME, department_name);
rec.setValue(db.DEPARTMENTS.BUSINESS_UNIT, businessUnit);
if (!rec.update(conn))
{
log.error(rec.getErrorMessage());
return 0;
}
// Return Department ID
return rec.getInt(db.DEPARTMENTS.DEPARTMENT_ID);
}