This first programming assignment, Assignment #2, is due Tuesday April 16th, and consists of designing and building your own simple database and then writing SQLJ code (Java) to work with it.
In all of this work you may find useful links on our database resources page.
Using the list below, keyed to numbers I handed out in class, you are to go to Snell Library and find a few recent issues of the journal listed (or to any other library that has the journal, or to an online copy that NU or you subscribes to). I personally looked over the recent issues of these journals, second floor of Snell Library at the front of the building, so they're really there. If you didn't get a number from me in class, email me right away and I'll give you one.
Your goal is to build a database of ten articles. You can shorten and simplify the article author list and the article titles to save yourself typing. For your database to be decently designed, you'll need to use at least two tables. The CAP database will give you some ideas. We'll be going into this in a lot more detail later, but here's a website for those curious about design.
At a minimum, your database should contain:
You should use actual articles you find in the journal assigned to you. You may shorten the titles of the articles to save typing. You may reduce the number of authors to two. (Your DB must contain some articles with more than one author.) You must make two other radical changes which will make the DB more "interesting":
You should use at least two tables in your design. The details are up to you.
To give you experience with a number of aspects of database work, do the following:
You can model your table definitions after examples in your textbook and in the file ~futrelle/3315sp02/toload.sql or look at simple examples such as this item.
Start by writing a very simple access program as well as having commands that update the rating field of an article. Then expand your code to include two different iterator uses, one to "dump" the entire DB and the other to list all the authors. You can model your code after the sources FundamentalExample1.sqlj and FundamentalExample2.sqlj, both in ~futrelle/3315sp02/. I already mentioned the classpath I used: $ORACLE_HOME/jdbc/lib/classes12.zip:$ORACLE_HOME/jdbc/lib/jndi.zip:$ORACLE_HOME/jdbc/lib/nls_charset11.zip:$ORACLE_HOME/sqlj/lib/translator.zip:. where $ORACLE_HOME on our unix systems evaluates to /arch/com/packages/ora8
Define and use one simple PL/SQL function in your code that updates the rating of a chosen article.
That's it!You should run a script to demonstrate how you set up your DB and what commands you used and what your program produced as output. You should also hand in your sql file, your dat file and your sqlj source code. You can do this by emailing the files as attachments or placing them in a directory that I can access. You must also write a short overview file that explains what you did and include that file also. Of course your grade will be much improved by giving your tables and fields meaningful names and by properly commenting your sqlj source code.
Extra credit: Most DB programs are driven by user input of some type.
Add a command line input facility that allows a user to type in some
very simple input that will then run a function you define to access
the DB and return input to the user. An example would be
A Jones
which would return all articles with Author "Jones".
Go to COM3315 home page (Gateway)
Return to Prof. Futrelle's home page