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:
·
ID
·
Firstname
·
Lastname
·
Nickname
·
CampStoreBudget
·
CampStoreSpent
·
RevNum
(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
JDBC.
·
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.
Related Questions
- Download M7script.sql to c:\cis4210.
- Start sqlplus sys/Oracle11 as sysdb...
Tutlance Experts offer help in a wide range of topics. Here are some of our top services:
- Math homework help
- Nursing homework help
- Statistics homework help
- Nursing coursework help
- Capstone project writing services
- Essay writers for hire
- Case study writing help
- Buy college papers online
- Buy college research papers
- College homework help
- Professional resume writing services
- Programming homework help
- Coursework writing help
- Term paper writing help
- Biology homework help
- Do my physics homework
- Dissertation data analysis help
- PhD Dissertation writing services
- Chemistry homework help
Post your project now for free and watch professional experts outbid each other in just a few minutes.