Please send questions to
st10@humboldt.edu .
CIS 480 - Spring 2001
HW #7
Due: Monday, April 30, 2001, beginning of lecture
Remember the class style standards at the end of this handout...
Note that you need to write 4-5 distinct, different Java programs for
this assignment. (You MUST send AT LEAST 5 e-mails, with the Subject:
lines Hw7Num1.java - Hw7Num5.java.)
If you meet the minimum requirements below, that up to 90% credit. If
you do something interesting in these programs, that's how you can
get up to 100%. Note that the possibilities given below do count as
"interesting" in this sense.
1. Modify Lecture 12/13's CreateTable480.java to create
a new table on *your* redwood Oracle account that has at least 5
columns, at least one of which is truly numeric (can have arithmetic
operations done sensibly on it!). It must be substantially different
in meaning from the example table table480!
* name your resulting code Hw7Num1.java
* suitable examples:
* friends' name, email, birthday, phone number, and
number of dinners out you owe them;
* your cds' title, artist, how much you paid for it,
date obtained, your personal rating of it;
2. Now, modify Lecture 13's TryPrepStmt2.java to nicely
handle interactive inserts into your table created in #1. You will,
of course, use a PreparedStatement to do so. This may simply
handle inserts to your table in a similar way as is done already,
or you may certainly "improve" it as you wish.
* name your resulting code Hw7Num2.java
3. BuildEmpFile.java and AskForCol.java are, then, two
applications that make different uses of a table thus created. You
need to write an application to do something interesting with your
now-populated database table as well.
* name your resulting code Hw7Num3.java
* suitable examples:
* create a nicely-formatted "report" file from the
table contents
* write an application that creates an HTML file (suitable
to be copied to your public_html directory, or it could put
it there using java.io classes) displaying an HTML table or
other nice display of interactively-specified information
from your table
* create a nice-but-still-on-sorrel interface for people
to access information from the table --- (AskForCols does
this, but in a quite limited way --- you could expand or
improve upon this.)
4. Either in one of the programs for #1, #2, or #3, or in a separate
program, make use of metadata (either ResultSet or Connection metatdata
will be fine). Some examples:
* in #3, if you allow the user to specify a table, you
might then use metadata to figure out how many columns are
in that table, so that you can iterate through them;
* you might write an application to allow users to more
easily figure out what tables are in a database, what columns
are in a table, what type of data is in a column, etc.
* you might write an application that lets users know
non-standard SQL features available on a database that
they have connected to, or gives them information about
a subset of features that are or are not supported
by that particular database.
* if this part is not combined with another part, or
if it is the "earliest" of several combined parts, then
you should name your application Hw7Num4.java.
* if you DO combine it, you STILL need to send
an e-mail with the Subject: Hw7Num4.java,
containing the *name* of the program that you
wish to also be graded for this part.
5. Finally, write a Java applet (note: better stick with AWT for this)
that interacts in some noticeable way with your now-filled table.
* name your resulting code Hw7Num5.java
* make sure that your name appears somewhere within
this applet
* make the proper choice between Statement and PreparedStatement
in your applet.
* some ideas:
* have a primary key textfield that, when entered into,
causes other textfields to be filled in with the other
attribute values for the record with that primary
key. Can you do this with more flair/elegance that
TryJDBCApplet1.java does?
* have a list component of items in your database, and
when one is chosen, show them one or more of the attribute
values for the chosen item
* have checkboxes with column names, and a button
that when pressed causes those columns checked to have
their values displayed
Minimal style standards (to be added to, if necessary!)
* If you want to "paint" using Swing components,
use the guidelines as discussed in class and as demonstrated
in the in-class examples.
* If your program involves gif files, either include
them as attachments in a separate e-mail file with
"Subject: [program name] images", OR include them on a web
page using the tag: <img src="YOUR_IMAGE.gif">
and include the URL for this page in your opening comment
block.
* The names of all required gifs, in either case,
must be included prominently and neatly in the opening
comment block, also.
* Java GUI applications must always include
System.exit(0), and must handle window closing gracefully;
* Run-time exceptions (such as, but not limited to,
NumberFormatExceptions) should be handled gracefully
by proper use of try-catch blocks.
* Any applet (AWT or Swing) must include in
its opening comment block its recommended size.
* every Java source file should begin with at least
a small block comment describing the purpose of what
is within, and including your name. If you are modifying
existing code (such as an in-class example), you should
indicate that, also.
* programs are expected to have at least a few
descriptive internal comments
* neat, consistent indenting is required.
* reasonably-descriptive and non-misleading variable
names are expected.
Then, send (at least) five e-mails to st10@humboldt.edu as follows:
* each Subject: line should be either:
* the name of Java source contained within that
e-mail message, OR
* the required name of the Java source that
would be contained there, if one program were not
being used for several parts, OR
* <required_java_source_name> images, if
it contains required image attachments.
* the *body* of the e-mail should contain either:
* the Java source (NOT included as an attachment!),
OR
* the name of the Java source to be graded
for this part, also; OR,
* the image file(s), as attachments.
* please FIX the indenting in the Java source code
if it is ugly when placed in the e-mail body! (Source code
pasted from BlueJ sometimes requires such clean-up.)