Do the following exercises:
Homework13
.
LoadDB
- Pull data from the OracleXE IMDB Movie, Actor and Role tables and load it into
Oracle KVLite using a key-value structure that supports the following queries. Note that you may need
create multiple key structures to support the different queries listed below.
Use JDBC to connect to the IMDB in OracleXE (see code/13postrelational/HelloJDBC.java
).
You’ll need to run both OracleXE and KVLite for this program to work properly and will need to
include the ojdbc library (see the GlassFish lib/ojdbc6.jar
). You should only
have to run it once before running any (or all) of the query programs specified
below on the resulting KVLite key-value database.
GetTableValues
- Get the basic field values from the Movie table. The
output should look something like this.
Table: movie ID: 92616 Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb 1964 8.7
This sample prompts for the table name and ID; you may read or hard-code these values. Also, the output ignores SequelId, which is fine for this assignment.
GetMovieActorRoles
- Get the roles, if any, for which a given actor is
cast in a give movie. Sample execution:
Movie ID: 92616 Actor ID: 429719 Dr. Strangelove Group Capt. Lionel Mandrake President Merkin Muffley
This example shows all three roles that Peter Sellers famously played in Dr Strangelove.
GetMovieActors
- Get the actors if any, who are cast in a given movie.
Sample execution:
Movie ID: 92616 427460 George C. Scott Gen. 'Buck' Turgidson 429719 Peter Sellers Dr. Strangelove 429719 Peter Sellers Group Capt. Lionel Mandrake 429719 Peter Sellers President Merkin Muffley
GetSortedMovies
- List all the movies in order of year. Sample output:
1960 238071 Ocean's 11 1964 92616 Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb 1972 130128 Godfather, The 1977 313459 Star Wars …
Name the programs as listed above and include comments in LoadDB
documenting your key-value structure and how it supports the various queries.
Store answers the following questions in a Homework13/notes.txt
file in your
solution application.
We will grade your work according to the following criteria: