Central Connecticut State UniversitySpring 2000
CS 407 Java Database Connectivity Final Project
For your final project, you get to use what you have learned about Java Beans and JDBC to write a complete, general, industrial strength database application. In brief, you are to write a Java database application, using the JDBC API, which will allow the user to
- Connect to an arbitrary MySql database on an arbitrary server as an arbitrary user. Of course, the user must be able to enter his or her password, and, of course, the password must not be printed in the password dialog box.
- Issue an arbitrary SQL query to the MySql database. The user must be able to type in and run queries of the following types:
- SELECT queries such as SELECT name, owner FROM pet WHERE species = 'cat'
- UPDATE, INSERT and DELETE queries.
- CREATE TABLE and DROP TABLE queries.
- SHOW queries such as SHOW DATABASES.
- DESCRIBE queries such as DESCRIBE pet.
- Clear the main query frame.
- Close a connection.
- Exit the application gracefully.
Your project must also include the following:
- At least two frames and/or panels. For example, the application I wrote contained a Connection dialog (that's one panel) and a main frame (that's one frame, makes a total of two frames and/or panels).
- An editable text area where the user can enter and edit his or her queries. The text must wrap on word breaks (white space).
- The text area must have scroll bars appear on its sides when the text grows too large. (Hint: Put the text area in a ScrollPane, or use one of the even more capable Java GUI components.)
You are free to include additional components such as check boxes, toggle buttons, radio buttons, etc. But there is plenty to do with the basic project, so you do not have to include any extra components.
You are free to use Swing objects rather than AWT objects. I found this useful.
You are free to include additional features in your application, such as an option for importing tables from a comma separated database. Ditto with exporting tables. But there is plenty to do with the basic project, so you do not have to include any extra features.
Your application MUST BE AN APPLICATION. It may NOT run as an Applet.
You must use your application to create a database containing several tables with data. I suggest using some of the table definitions in the Microsoft Access Northwind demonstration database, and entering some of the data (maybe 5 or 6 records per table) from that database. Northwind will be on ANY system which has Microsoft Access installed, including the machines in the classroom and the machines in the University Microcomputer Laboratory. Do a Find for Northwind.mdb.
You may work in teams of two, or you may work individually.
Here is some material to help you:
- MySql Database Resources Page. The MySql tutorial and reference manual is especially helpful for learning basic SQL.
- Java JDBC Demos Page. The demos here show you how to load the mm JDBC-MySql driver, make a connection, and issue a simple select query. To issue general queries, use the stmt.execute(queryString) method. Note: The documentation in the remarks taken from the mm driver page is not correct: stmt.execute returns a boolean value, not an integer. The handout gives the correct information.
- TableExample.txt.The example code here shows you how to work with tables to display the results of queries. The code has been tested, AND IT WORKS.
- An Image of the MAIN Database Application Frame in action in the database application I wrote. This image is presented for inspiration only, and you are free to be creative.
- An Image of the Connection Dialog in action in the database application I wrote. This image is also presented for inspiration only, and you are free to be creative.
What to hand in:
- One folder per team.
- The folder must have pockets (see the project 1 description), containing
- a word processed or typed title page,
- a word processed or typed list of files (how else am I going to know what to run), any needed information about setting classpaths (on the page with the list of files),
- a word processed or typed list of objects together with a brief CRC Card style description (see Demos 19 through 26 on the CS 151 Demos page and the CS407 MultiTasking and Video Games Demos page),
- and a CLEAN 3.5" PC formatted floppy disk containing your .java and .class files, and any other supporting files (such as image files) that your application needs to run.
- Be sure your disk does not contain unneeded duplicate copies of files. If I have to hunt around for the correct versions, you will NOT make a good impression.
Be SURE you test your application on the VERY FLOPPY DISK YOU HAND IN. If it doesn't run for me you will NOT make a good impression.
Due the day of the final exam, Thursday, May 17, at the beginning of class.
This page is best viewed with Netscape Navigator.
Return to the CS 407 JavaDB Home Page.