CSc 8710. DDLP
Fall 2000, HW 5 (Geography Database in ObjectStore)
Due: Monday, November 6th
The project consists of 3 parts:
- Part I: Design an object database for the
geo.xml database.
- Part II: Write a program in Java that populates an ObjectStore
database with the data.
- Part III: Write a
program in Java which implements the following menu-based system:
MAIN MENU
(1) Given the first letter of a state, print all states along
with their capital city names.
(2) Print the top 5 populated states in descending order of population.
(3) Given a state name, list all information about that state,
inlcuding capital city, population, state nickname, major
cities, etc. The report should be formatted nicely.
(4) Print an alphabetical count of number of states for each letter of
the English alphabet. (Nicely formatted; 4 letter counts to a line).
The count is the number of states whose names begin with the letter.
(5) Quit
The Java program should access the ObjectStore database created
in Part II.
Some instructions on how to compile and execute ObjectStore programs:
-- Please copy ~raj/.cshrc and ~raj/.alias one more time into
your home directories so that you can start using ObjectStore
create directory for assignment
$ mkdir ~/8710/os/geo
create directory for annotated class files
$ mkdir ~/8710/os/geo/Classes
move to geo directory
$cd ~8710/os/geo
Now, create java files corresponding to Database classes here.
e.x. Movie.java, Star.java and Studio.java go here
compile these files using
$javac *.java
create a file, called cfpargs, containing one entry per class which
you want to make persistent. example:
Movie.class
Star.class
Studio.class
The following command will produce annotated files that makes database
objects persistent.
$osjcfp -dest Classes @cfpargs
Move to Classes directory
$cd Classes
Now, create your application programs here. Ex. createData.java and
readData.java files go here.
$javac createData.java
$javac readData.java
Run the application programs
$java createData movie.odb
$java readData movie.odb