ITEC 340

Homework 4

 

In homework 3 you developed a database schema for a camp store.  For homework 4 you will use JAVA and JDBC to construct a cashier application to record camp store purchases.   Your completed application should look approximately like the screen shot below:

 

Behavior:

 

The initial state is for the Camper ID textbox and the Find button to be enabled.  All other controls should be initially disabled.  To retrieve a camper the cashier enters a camper ID and then clicks the Find button.

 

If the requested camper is not found in the database the state of the buttons and textboxes should not change but a message in the message are should report “Camper not found with that ID”.

 

If the retrieval is successful then:

 

   The name and balance of the camper is displayed.

   The Camper ID will still display but will be disabled.

   The Find button will be disabled.

   The Submit and Cancel buttons will be enabled.

   The message area should stay blank.

 

The cashier can then select a category off of the drop down list  (The drop down list values should be driven by the database table “categories”), enter the amount and then click on the submit button.  When the submit button is clicked:

 

    If there are insufficient fund then

         The message area should display “Insufficient Funds.”

    Else

         The charge should be inserted into the database

         The balance at the top of the screen should be adjusted.

         The amount field should be cleared

         The message area should display “Charge recorded.”

 

If the clear button is pressed at anytime the application is set back to its initial state.

 

There should be no JDBC in your GUI.  This homework is worth 20 point and IS THE BASIS FOR FUTURE HOMEWORKS so Get-R-Done.  Submit your .java files to an RU04 folder in the dropbox by midnight on Tuesday March 7th.  DO NOT submit the Oracle library.