JDBC GUI with two factory classes and a trigger.

Congratulations, you know run a summer camp for kids.  Create a table named CAMPERS on your Oracle

account that has these fields:















(make the type Number(8) Default 1)

You will use REVNUM field to keep track of mutations as we

discussed in class.  So write a trigger

that increments the REVNUM field by 1 every time there is an update event.

Now, write a Java CAMPER class with fields that reflect the

structure of your new campers table.

Write a java FACTORY class with these two methods:


getCAMPER(String ID)  that returns a camper object for the

requested ID.  The camper object that is

returned should have field values that were loaded from the database using



saveCamper(Camper CamperToSave) that returns a

string indicating whether the camper object that was passed in was successfully

saved to the database or not.  Your save

method should save the last name, first name, nick name, CampStoreBudget, and

CampStoreSpent balances.  The method

should not change the ID and of course the RENNUM field will increment

automatically because of your trigger.  If

the save fails due to a mutation error the string returned by this method

should indicate that.


Note:  The factory class is the only

class in your project that should allow JDBC code


Write any other classes you need to produce a java

application that allows you to retrieve a camper into a GUI, change something

about that camper (except for the ID which should be read only), and save the camper

back to the database.   After a save

please let the user know if the save was successful or not.


Your program should implement an optimistic locking

strategy, checking for mutation by using the revnum field.   You can test your locking strategy by

opening two copies of your program, retrieving the same camper in each, and

seeing if your program prevents one session from overwriting the changes of the

other session.

Get Help With a similar task to - JDBC GUI with two factory classes and a trigger.

Login to view and/or buy answers.. or post an answer

Related Questions

Similar orders to JDBC GUI with two factory classes and a trigger.
Oracle Database
  • Download M7script.sql to c:\cis4210.
  • Start sqlplus sys/Oracle11 as sysdb...