Answered step by step
Verified Expert Solution
Link Copied!

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 21-2: 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
1- Guitars
2- Basses
3- Drums
Enter a category id (999 to exit): 2
BASSES
Code Name Price
--------------------------------------------------------------
precision Fender Precision $799.99
hofner Hofner Icon $399.50
CATEGORIES
1- Guitars
2- Basses
3- Drums
Enter a category id (999 to exit): 3
DRUMS
Code Name Price
--------------------------------------------------------------
ludwig Ludwig 5-piece Drum Set with Cymbals $699.99
tama Tama 5-Piece Drum Set with Cymbals $799.99
CATEGORIES
1- Guitars
2- Basses
3- Drums
Enter a category id (999 to exit): 999
Bye!
Specifications
You will be provided with a database file and driver (guitar_shop.sqlite, sqlite-jdbc.jar) 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
add/jar 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

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_2

Step: 3

blur-text-image_3

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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions