CS 485 - Database Management - Fall 2004
Homework 7
Loyola College >
Department of Computer Science >
CS 485 >
Homework >
Homework 5
Due
Monday, November 15th
Assignment
- Write a .sql file that creates a single table (include your name in the table name) with at least 3 columns, one of which must be a NUMBER. Make the first column the primary key. Then load at least 10 tuples. Then execute the .sql file in SQL*Plus. You will use this table for the remaining assignment.
- Write 4 Java programs, each using embedded SQL. Each should be carefully formatted and include both introductory and in-line commentary. In each case, have the user input the username and password for the connect statement.
- Program 1 This program should select a single record using a primary key value inputted by the user. It should print the tuple in a nicely formatted way.
- Program 2 This program should print the entire table (again in a nicely formatted way).
- Program 3 This program should select and print all tuples from the table that have a non-key field value equal to the input by the user.
- Program 4 This program should update an attribute of all tuples that satisfy come condition. The user should input the value for the condition and the new value. Afterwards, the program should print the entire table.
All of your code may appear in main if you wish. Be sure each program has sufficient in-line documentation to explain what is being doen at each step.
.
Submit
- A printed version of each .java and .sql file
- Copy an electronic version of the same files to my directory. Make sure that your name or initials are included in each file name.
Java Refresher