Mini-project
Work on this exercise in the pairs assigned by your instructor, striving to use good principles of Pair Programming.
Feel free to ask questions of your instructor, student assistants and classmates as desired.
Goals
The goals of this project are to:
- Learn the basic concepts in database connectivity.
- Gain familiarity with the JDBC (Java Database Connectivity) API.
- Learn some basic SQL (Structured Query Language) commands.
- Practice formal techniques of software development, including specifications, UML design, iterative enhancement plans, task lists, schedules, and screen layouts.
- Gain experience working in a larger team.
Basic Specification
You will be given a real-life database on
nutritional information. Your project is create an application that allows this data to be used in a socially beneficial way.
Guided database warmup
Vocabulary
- A database is an organized method of storing and accessing a large amount of information.
- A table contains many records, each of which contains related information on a single line, like in a spreadsheet.
- Keys are used to identify data in a record.
- Flat databases keep all data in a single table. Relational databases break up data into separate, smaller tables to eliminate redundant information.
- Design of relational databases is complex and fun. However, we don't have time for that here (and that's why we have CSSE333).
- Things that we can do to a database include creating and deleting tables, editing, adding and removing records, and searching for information.
Demo
Your instructor will demo a database and explain the main parts of connecting to a basic database in Java.
Activity
- Please unzip the sample project in this folder into your workspace. It contains a simple (flat) sales database.
- Create a driver for the Sales database found in the project. Select Start->Control Panel->Administrative
Tools->Data Sources; click Add; select Microsoft Access Driver; enter Sales for the Data Source Name; click
select; browse into the SalesFlatDB project folder and select Sales.mdb in
the left window. Select OK as often as needed to finish.
- Import the Project into your workspace; Run the program and study the code with your instructor.
- Please refer to the text for info on SQL commands, so you can modify your program to do the following:
- Add code so that only the first names of all entries in the database get printed.
- Add code so that only the phonenumber of all persons who's first name starts with a "J" gets printed.
- Add code so that an additional person gets added to the database.
Detailed specification
Refer to the MiniProject Specification file; go over it with your instructor.
Start working on your project, as directed by the specification.
You should be committing code via Subclipse to your team's repository at least
at the end of every phase of the IEP. Format:
http://svn.cs.rose-hulman.edu/repos/username1-username2
(where the 2 usernames are alphabetized).
Don't forget to check in your final project!
Resources
SQL Tutorial