Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this Java Project Project 2 1 - 2 : Products by Category Create an application that accepts a category id and
I need help with this Java Project
Project : Products by Category
Create an application that accepts a category id and displays the products in that category from the tables
in a database.
Console
Products by Category
CATEGORIES
Guitars
Basses
Drums
Enter a category id to exit:
BASSES
Code Name Price
precision Fender Precision $
hofner Hofner Icon $
CATEGORIES
Guitars
Basses
Drums
Enter a category id to exit:
DRUMS
Code Name Price
ludwig Ludwig piece Drum Set with Cymbals $
tama Tama Piece Drum Set with Cymbals $
CATEGORIES
Guitars
Basses
Drums
Enter a category id to exit:
Bye!
Specifications
You will be provided with a database file and driver guitarshop.sqlite, sqlitejdbcjar that contains
tables that store the data for the categories and the products. Both these should be copied into the root
of your application. You should right click on the Library folder in your application and click on
addjar folder find the jar file you placed in the root of your application.
Create Category and Product classes that you can use to store with the data from the Category and
Product tables of the database.
Create a class named ProductDB with methods that provides a method for getting all categories and
another method for getting all products for the specified category.
Use prepared statements to retrieve the data.
Make sure to close database connections, prepared statements, and result sets when youre done with
them.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started