COMP7120 Database Systems II: Final Examination, Spring 2001
Name:
SSN:
For JDBC programs, the following part can be skipped:
import java.sql.*;
import java.io.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
...
DriverManager.registerDriver (
new oracle.jdbc.driver.OracleDriver ( ));
Connection conn = DriverManager.getConnection (
"jdbc:oracle:oci8:@csedb", "ops$userid", "password");
select * from person where age > 50;
- (OODB Language) If an employee IsA person, the above query may result in heterogeneous sets. (8%)
- Explain the two methods to solve the problem.
- Discuss the further processing needed for each of the above two methods.
- (Inheritance) Inheritance conflicts may occur when a class has two immediate superclasses. Explain the three methods to solve the issue of inheritance conflicts. (8%)
classA: [attr: classC];
classB IsA classA: [attr: classD];
- (Safety) Explain why the type of a redefined attribute must be a subtype of the type of the original attribute, e.g., the classD IsA classC. (8%)
- (DOM) Explain how the Trader mediator works in a DOM system. (8%)
- (ORB) What are the differences between the ORB and RPC (Remote Procedure Call)? (8%)
create type book_typ as object (
title char(32),
author char(32) );
create table book of book_typ;
- (JDBC and Stored Procedures) Give a JDBC program list.java which responds to the query from the following interface. The list.java contains a stored procedure which includes all the SQL commands of the list.java. (14%)
- (Integrity Constraints and JDBC) (16%)
- Implement a book database using ON DELETE CASCADE clause. Two books may have the same title.
- Give a JDBC program delete.java which responds to the query from the following interface.
- (Trigger and JDBC) (12%)
- Implement a trigger which increases the updated book price by 10.00 if the updated price is less than 0.00.
- Give a JDBC program update.java which responds to the query from the following interface.

Sample values of a relational student enrollment database, of which sid, cno, and (cno, sid) are the primary keys of tables S: students, C: courses, and E: enrollment, respectively.
- (Integrity Constraints, Views, and Security)
- Create a view, Sview on the table S, that is updatable and will keep any user who updates Sview from changing the class column to a value less than 1 or greater than 4. (6%)
- Assume we have a missing integrity on the the class column for S, i.e., the value of the class column must be greater than 0 and less than 5. Give a SQL command to ADD this integrity constraint to the table without re-creating the table. (6%)
- Give SQL commands to grant privileges to a user name Johndoe to be able to look at the S table columns sid, lname, class, and telephone, and update either of the columns class and telephone. (6%)