Semester project for CS430 Fall 2015. Constructing a simple Java GUI application and Oracle database backend for users at a university (students/faculty/staff) to view and edit data.
Primary keys are in bold.
Student( sid: integer, sname: string, major: string, s_level: string, age: integer)
Courses( cid: string, cname:string, meets_at: string, room: string, fid: integer, limit: integer)
Enrolled( sid: integer, cid: string, exam1: integer, exam2: integer, final: integer)
Faculty( fid: integer, fname: string, deptid: integer)
Staff( sid: integer, sname: string, deptid: integer)
Department( did: integer, dname: string)
- Java JDK 7 or 8
- Access to CS Oracle DB server
- SQL*Plus Oracle client
- Open a terminal window.
- Go to the project directory.
- Compile using JDK
javac *.java
- Using SQL*Plus client, log into Oracle DB server
- Remove and existing tables or views with the same names by running the RemoveAll.sql script
START /path/to/project/directory/RemoveAll.sql
- Load the DB schema using the Schema.sql script
START /path/to/project/directory/Schema.sql
- Load the example entries using the ExampleData.sql script
START /path/to/project/directory/ExampleData.sql
- Optionally, set the classpath
export CLASSPATH=$CLASSPATH:/full/path/to/project/ojdbc6_g.jar
in Linux
set CLASSPATH=C:\full\path\to\project\ojdbc6_g.jar
in Windows - In the project directory, run the main class.
java MainClass
if the classpath was set
java -cp ojdbc6_g.jar:. MainClass
if the classpath was not set - The login to the Oracle database may take some time. Please be patient.
- When the project is run for the first time, a dialog should appear prompting for the entry of the DB username and password.
- Enter the Oracle DB username and password and check the Save Configuration box to save the username and password to a file.
- The saved configuration will be in plain text and in the file '.cs430dbconfig' in the user's home directory.
- Click the Login button.
- If the project has been run before and the configuration was saved, the program will start at this point.
- Wait for the program to log into the database. This may take some time.
- A user login dialog will appear. Enter a user id from the sample data (either staff, faculty, or student).
- Click Login.
- If logging in as a student, the student window will appear.
- The student can view information about themselves and a list of classes they are enrolled in.
- Selecting an enrolled class from the list enables the Drop button, which can be used to drop the selected class.
- The student can also view or search for available classes.
- Enter search terms in the fields and click the Search button to find a class.
- Click the Clear button to clear the fields and search results.
- Selecting a class from the list enables the Enroll button, which can be used to enroll in the class.
- If logging in as staff or faculty, the faculty/staff window will appear.
- Staff can search, add, edit, or delete information from the database.
- Faculty can only search for information in the database.
- Each of the tabs represents a table in the database: Students, Faculty, Staff, Departments, Courses, Enrolled.
- On each tab, certain functions are available (all for staff and search only for faculty).
- Each tab will populate the table with all information from the database in the related database table when selected.
- Search terms can be entered in the fields. When the Search button is clicked, the results show up in the table.
- A new entry can be made by entering data into all the required fields and any other fields desired, then clicking the New button.
- When an entry from the table is selected, the fields are automatically filled in with the data from that entry.
- Any field with the exception of the primary keys can be changed. The changes will be saved to the database when the Edit button is clicked.
- Alternatively, the Delete button can be clicked and the entry will be removed from the database.
- Either action will reset the fields and the displayed table.
- Entries on any tab cannot be deleted if they violate the referential integrity constraints in the database.