Fabflix: Project 1 

Due: April 9th, Wednesday, 11:45 pm. Submit on EEE under drop box / CS122B Project 1.


Project 1 Goals

In this project you will create a database for an online movie website using the relational database management system MySQL. You will populate the database and connect to it using client Java programs. The database will contain information about movies, so that we can sell this valuable information to customers.

Creating the database

Here are the steps we need to accomplish for this project:

In an actual development effort, the functional and look-and-feel requirements for these functions would have been specified in every particular. We've purposely left these requirements high-level because we want you to use your skills, experience and reasoned judgment to refine the requirements. Do feel free to ask the instructor or TA for advice! With instructor or TA permission, you can also enhance these specifications for potential additional credit; for example, you can use the GUI rather than a console interface. But be careful: including additional features that do not work will detract from your score.



Schema

Create your movie database! The following chart gives the database schema; for each table, its name, attributes, and any notes about the attributes are provided.

All varchar() fields for which there is no data (i.e., the fields contents are missing or unknown) are the empty string (''); other non-required fields which have no data are null. Required fields have the constraint that they are not null.

Table Name
Attributes
Notes
movies
id:integer (primary key)
title:varchar(100)
year:integer
director:varchar(100)
banner_url:varchar(200)
trailer_url:varchar(200)
required
required
required
required
URL of movie's "poster"; not required
URL of trailer; not required
stars
id:integer (primary key)
first_name:varchar(50)
last_name:varchar(50)

dob:date
photo_url:varchar(200)
required
for a person with one name,
   put it in last_name
   & make first name NULL
not required
not required
stars_in_movies
star_id:integer, referencing stars.id
movie_id:integer, referencing movies.id

all attributes required
genres
id:integer (primary key)
name:varchar(32)

all attributes required
genres_in_movies
genre_id:integer, referencing genres.id
movie_id:integer, referencing movies.id

all attributes required
customers
id:integer (primary key)
first_name:varchar(50)
last_name:varchar(50)
cc_id:varchar(20), referencing creditcards.id
address:varchar(200)
email:varchar(50)
password:varchar(20)
all attributes required

for a person with one name,
   put it in last_name
   & make first name 'non

enforce uniqueness on both email and password.
sales
id:integer (primary key)
customer_id:integer, referencing customers.id
movie_id:integer, referencing movies.id
sale_date:date
all attributes required
creditcards
id:varchar(20), (primary key)
first_name:varchar(50)
last_name:varchar(50)
expiration:date
all attributes required

for a person with one name,
   put it in last_name
   & make first name 'non

Write a JDBC program

Write a Java program that, using JDBC to interface with MySQL, provides for the following functionality. It can be console based (or GUI, as discussed above).

When this program is run, the user is asked for the the user name and the user password (the database user login info not the password in the above schema) . If all is well, the employee is granted access (and a message to that effect appears on the screen); if access is not allowed, it says why (e.g., the database is not present, the password is wrong). Allow a way for the employee to exit easily.

Provide a menu that allows the employee to do the following:

In cases where the requested tasks cannot be accomplished, print out a clear, crisp error message–do not just pass along some Java exception!

Upon completion of any command except the exit commands, the user is returned to the menu.


Deliverables

Please, pack all the required files in one zip file, here is the list of what needs to be sent:
If your project does not compile or if your SQL scripts generate errors such a project will get a very low score if any.
The due date is: Apr 9, Wednesday, 11:45 pm. Use EEE to submit, for that go to "http://eee.uci.edu".

Login onto EEE using your UCInetID. Under our course COMPSCI 122B, click Dropbox. Under Folder View, click CS122B Project 1/Assignment Submission. Upload your zip file there. Please notice that after the deadline you will not be able to upload your files to the system any more.


Demonstration

You are required to demonstrate  this project. Create a running system from your ZIP file–quickly. Show the correctness, completeness, functionality and performance of your database during your demonstration by using the employee interface developed here. Your task is to convince us (in 20 minutes) that your work is correctly and completely carried out and the Fabflix project is ready to move to phase 2. Your demo will include the following:

a) Setup your application using the files  you submitted on EEEThe grader will upload these files on your PCs. You must have already installed Cygwin and MySQL.

b) Demonstrate that your creatable.sql file creates a valid database. Since execution of the data.sql can take too long, you should have already setup a database
and populate it. This database will be the one accessed by your demonstrated JDBC program. Thus, creatable.sql will be executed for a  database under a different name and get populated by executing data.sql, while you are demonstrating other parts of the project. 

c) Demonstrate the correctness, completeness and performance of all the required features.

Please note that you will have no more than 20 min to demostrate.  It is completely up to you to plan your demo so that all the required features are displayed and the grader  can be convinced of the quality of your work in the given time frame. If a group's demonstration appears to be unstructured, the demo could be aborted and rescheduled for another time with a substantial grade penalty.

Demonstration schedule will be posted later.  All demonstrations will be held in room CS 364..



This project was first drafted by Chen Li and Kirill Petrov in Winter 2005. It was modified by the following contributors: Norman Jacobson and Kirill Petrov (Spring 2005); Norman Jacobson, Chen Li, and Michael Sirivianos (Winter 2006); Chen Li and Michael Sirivianos (Spring 2006); Chen Li and Shengyue Ji (Winter 2007); Chen Li and Chaitanya Desai (Spring 2008); The data.sql file was built by combining student data sets from previous offerings. The aggregate data set was cleaned from duplicates and other errors using a PL/pgSQL script written by Eric Murakami  and Chris Trezzo (Winter 2006).