Lab assignment work must be submitted electronically by midnight at the end of the day that it is due. Programming work submitted after the deadline but before the "late deadline" -- midnight 48 hours after the deadline -- will be accepted but penalized 50%. No lab assignment work will be accepted after the late deadline.
Being the expert that you are (you have taken CMPS180 after all!), you decide that you will use JDBC to handle all connections to the database from within your applications. Fortunately for you, someone has already written a short guide on how to use JDBC on db.ic.ucsc.edu. You may also want to check out the official JDBC documentation from the source itself.
The application can have a text-based interface, although extra points will be awarded if you program a GUI. On start-up, the application should request a user-id and password, or give the option of creating a new account. After the user is authenticated (by supplying a correct username/password or by creating a new account), all transactions to the database will apply to the given user only.
Once logged in, the user is given the following options:
Navigating through search results. The user should be able to navigate through long lists of search results. If you build a text-based application, this means that the user should be able to look at the results in pages, and should be given the option of moving back and forth; if you build a GUI application, then the user should be able to scroll through the results. Of course, once the user is done browsing the results, he/she should be able to close the results view and perform another search.
Purchasing songs. The user can always select to buy a song from the list of results. In this case, the application should switch to a purchase screen, where the user is shown again the song he/she selected, and the available bitrates. Once a bitrate is selected, the user can pay with a pre-registered credit card. At any point in this process, the user should be allowed the option to back-out of the purchase and return to the list of results. If the purchase is completed, then the transaction should be recorded in the database, a notification should be presented on screen, and the user should be returned to the list of results.
In all cases, if an error occurs during the interaction with the application (or during the communication with the database), make sure to give to the user a meaningful error message.
Extra Credit. You will receive extra credit for each of the following features:
What to turn in: Please see Recording Your Session below for a guide to preparing output to be submitted for this and subsequent project parts. In this and all subsequent project parts, the material you turn in should be clearly formatted and delineated, and should include comments for any aspects that are not crystal clear. Poorly assembled or documented material will not receive full credit, even if it is correct. You also will not receive full credit if you turn in your entire large data files (or large query results in later assignments) when we ask for small samples. Other than comments, truncation, and simple formatting, it is Academic Dishonesty to edit scripts before turning them in.
For this part of the assignment the following files should be turned in electronically using your cats account and the submit program:
| README | Please give your name, cats account, project part number, date, a list and description of the files you are submitting, and any other information that will be useful for the grader. |
| app.zip | A zip file with all the source files for your application. The README file should include instructions on how to compile and run the java class files. |
To submit these files use the syntax:
submit cmps180-np.w04 proj4-part1 README app.zip
or proj4-part1-late if your project part is late.