Overview | Schedule | Announcements | Resources | Assignments | Home |
Examine |
This project falls far short of implementing a database management system and will continue to have many deficiencies after you complete this lab. But there are several things you will accomplish that will help make the project a better one from a data management point-of-view. If you are not already familiar with the Company database project, you might create an instance of CompanyDB and invoke its methods:
Each method above calls a method in another class. addDepartment() calls a method in Deptform, queryDeptManagers() and querySalary(String relop, double sal) call methods in the Query class, and shutDown() calls a method in the Department class. Before proceeding through the next steps, become familiar with the methods and fields in each of the classes of the project by looking at their code in the class editor. |
Write |
A Deptform object can be used to add a new department to the database. The Submit button action checks for a blank department name and a blank department number, but not for a department number that is the same as the one currently entered. Write a method named find in the DepartmentTable class that has mgrssn as a parameter and returns true or false according to whether there is or is not already a department with that mgrssn. Modify the Submit button action, using the find method above to determine whether to add the department represented in the form. If find returns true, do not add the new department (it is already there), otherwise add the department. If the department is not to be added, modify the label at the bottom of the Deptform accordingly. |
Imitate |
Using the save method in the DepartmentTable class as a template, write a save method for the EmployeeTable class. Add a call to this method to the shutDown method in CompanyDB. |
Do |
Write a new query that lists all fields for
each employee in a given department. The signature of the method
would look like: |
Modify |
Add statements to the constructor for CompanyDB so that the forms to add a department and to add an employee are automatically displayed when an instance of CompanyDB is created. |
Overview | Schedule | Announcements | Resources | Assignments | Home |
DePauw
University , Computer Science
Department , Spring 2005
Maintained by Brian
Howard ( bhoward@depauw.edu
).
Last updated