Assignment #3       Com S 561      40 points          Due  March 10, 2008

 Example is available in the form of an Eclipse project.  To download the project in zip format click here.

a)Program A: Use the data below to create a set of objects in Java.  Write the objects out to an object file using Java’s

ObjectOutputStream file.  The object format is

 

public class Employee{

  private String employeeID;

  private String employeeName;

  private String employeeAddress;

  private String projectGroup;

  private String department;

}

 

Data:

employeeid         name                       employeeadd              projectgroup       dept

1014                   John Doe                 Des Moines,Ia           sales                     sales         

1020                   Janet Toms              Ames,Ia                      it                          it                

1030                   Mary Rivers           Boone,Ia                     it                           it

1040                   Barry Able              Des Moines,Ia           sales                     sales

1050                   Dana Jones             Ames,Ia                      design                  engg          

1060                   Don Jones               Ames,Ia                       it                           it

 

b) Program B:Use the file created in Program A to serve as the input file for a program to that will read the objects from the file

and store them in a database using Hibernate.

 

c) Program C: Create a program that uses JOptionPane.showInputDialog() for input from the keyboard and JOptionPane.showMessageDialog()

for displaying student results.  The program should support the ability for the user to add, delete, retrieve/display employee records, and write the

list of employees to a text file using the Hibernate database.  Add at least two new employees and delete at least one original employee to show that

your program is working.

 

d) How would your Program C change if you used the file created by Program A instead of the Hibernate database?

 

e) Hand in the printouts of your source code and a printout of the file created by program C after testing your programs.