Write a Java PATRON class with fields that reflect the structure of your patrons table. Write a...

80.2K

Verified Solution

Question

Programming

Write a Java PATRON class with fields that reflect the structureof your patrons table.

Write a java FACTORY class with these two methods:

  • getPatron (String patronID) that returns a patron object forthe requested patronID. The patron object that is returned shouldhave field values that were loaded from the database usingJDBC.
  • updatePatron(Patron PatronToUpdate) that returns a stringindicating whether the patron object that was passed in wassuccessfully updated in the database or not. The method shouldupdate all patron fields except for the patronID which we willconsider immutable.

Note: The factory class is the only class in your project thatshould allow JDBC code

Write any other classes you need to produce a java applicationthat allows you to retrieve a patron into a Graphical userinterface, change something about that patron (except for thepatronID which should be read only), and save the patron back tothe database using your update method.   After an updateplease let the user know if the update was successful or not.

EDIT: Patrons Table SQL

Create table Patrons (
PatronID int not null constraint PatronID_PK primary key,
FirstName varchar(255),
LastName varchar(255),
Address varchar(255),
City varchar(255),
State varchar(255),
Zip int,
Phone varchar(20),
Email varchar(255) constraint Email_UK unique,
CardType varchar(30),
Constraint CHK_CC check (CardType in('MasterCard', 'Discover','Visa', 'Amex')),
CardNumber varchar(20),
BirthDate date);

Answer & Explanation Solved by verified expert
4.4 Ratings (709 Votes)
public interface Shape void draw public class Rectangle implements Shape Override public void draw SystemoutprintlnInside Rectangledraw method public class Square implements Shape Override public void draw SystemoutprintlnInside    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students