Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Start 1.) Create a 3 layer application in Java, where the top layer is the User Interface, the middle layer is the business layer, and

Start

1.) Create a 3 layer application in Java, where the top layer is the User Interface, the middle layer is the business layer, and the bottom layer is the database connectivity.

2.) The user interface will present a GUI to the user, asking them to enter some information, and to interact with the stored data. Refer to your previous assignments. You can use your code or start from scratch. (The exact functionality provided to the user is deliberately vague here.)

3.) Create a connection to a relational database using SQLite or MySQL.

4.) Create a single database table to hold information. Go back to the previous assignments, and re-use your classes, or modify them as you like. Recall that you will create the DB only once. You can just comment out the code that creates it if you like. Some people find a way to detect if the DB is already there. Thats fine, but not required.

5.) These requirements are taken from the previous assignment. This time the user is to be presented with a GUI that allows these things to be done. So the data is not hard coded, the user will fill in a GUI click a button to interact with the DB. When you retrieve the data from the database it should populate the GUI to demonstrate that it is working.

6.) Demonstrate the insertion of a record into the database. Create a method in the Data layer that takes a Person as a parameter, and puts that data in the database. Insert several records.

7.) Demonstrate the retrieval of information from the database. Use SQL Select statements.

8.) Write a method called getPerson that returns a Person object. This method retrieves the data for a Person from the database. We also need to pass a parameter to identify what person. You can use name if you like, or if you find it easier to use the database generated ID thats fine too. This method returns the object that represents that person. This will require that you extract the data that is returned from the database, and call the Person constructor. Note that this is the data-exchange between the relational database and the business layer.

9.) Write a method called findAllPeople that returns an ArrayList of objects containing all the people in the database.

10.) Write a method called deletePerson that removes a person from the database. The parameters will be first name and last name. Print out on the console the data from the record that is being deleted. Use your findAllPeople method to verify that that person has been removed from the database. Consider what this method should return. Suppose the person is not found, should the method return that information somehow?

Deliverables. 1. Write a brief description of how far you got, and what your difficulties were with this project.

2. Include some screen shots that show the user interface, and the interaction with the console.

3. Paste in all the code using copy / paste from Eclipse - not screen shots of code. Include the output console from running the code.

Required/Important Files:

https://drive.google.com/drive/folders/12kAyskYrmiNJFgXIW-YBEAliKmKhSS7H

(Optional) Here is a demonstration for getting started:

https://www.youtube.com/watch?feature=player_embedded&v=VbuLXze6xf8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

Connect with business communities

Answered: 1 week ago