CIS612Homework 8 – Developing Database Solutions with Oracle & .NET Due. We. 8-Nov-2006
Fall 2006
V. Matos
Consider the ORACLE company database whose schema is provided below.
EMPLOYEE (fmane, minit, lname, ssn, birthdate, address, sex, salary, superssn, dno) KEY: ssn
DEPARTMENT (dname, dnumber, mgrssn, mgrstartdate) KEY: dnumber.
PROJECT (pname, pnumber, plocation, dnum) KEY: pnumber.
WORKS_ON (essn, pno, hours) KEY: (essn, pno)
DEPENDENT (essn, dependent-name, sex, bdate, relationship) KEY: (essn, dependent-name)
Write a Windows-based C#.NET or VB.NET application to communicate with the Oracle versionof the COMPANY database and accomplish the following tasks
- The .NET application will use ADO.NET controls (Connection, Command, DataReader, DataAdapter, DataSet,…).
- The app will consist of a main form where employees will be displayed one at the time.
- The form includes:
- Textboxes showing ssn, full-name, address, dno, dname, sex, salary, SuperSsn for the current employee.
- Two DataGrids, one displays all the assignments in which the employee works and the second shows his/her family members.
- A NEXT command button to navigate from one employee to the other (forward only!) and correspondingly update the DataGrids.
- An Update button to change the employee’s salary field.
- A Print button to create a report showing all of the current employee’s data (personal values held in the EMPLOYEE table, all of his/her assignments stored in WORKS_ON, all of his/her family members as indicated in the DEPENDENT table).
- An Exit button to close the form.
NOTE:
- Preparation of Test Data. Use the database instance provided in Elmasri-Navathe Fig. 5.6.
- You must use ADO.NET objects.
- Please DO NOT USE the DataForm wizard to assemble the GUI.
- The report requested on step e should be made using the CrystalReport facility.
- Use an ODBC data source (create a set called “myOracleODBC” for CsuPerson/Euclid) to reach the (XE) ORACLE database.
- You will use the GetFullName (aSSN )PL/SQL function to return the (salutation + employee’s full name). For instance if the current input SSN is 123456789 your output should be a string such as “Mr. John Smith”. You must create and use the server-side function.
- Create a trigger to guarantee that salary modifications do not violate thefollowing business rule “the NEW salary of an employee must be higher than his/her OLD salary”
- (Try to) Change the salary of employee 123456789 to $1M.
- (Try to) Change the salary of employee 123456789 to $0.5 M.
- Print the PL/SQL and MS-Access code, provide screen-shots of the form & data