Attached files: https://www.dropbox.com/sh/qngwy0jvsglgadq/AAAeVpn9_uvTBc4V67FdydLLa?dl=0 For derby: https://www.dropbox.com/s/e1up0e7wugomt07/derby%282%29.jar?dl=0 Complete a Java program named...

Attached files: https://www.dropbox.com/sh/qngwy0jvsglgadq/AAAeVpn9_uvTBc4V67FdydLLa?dl=0 For derby: https://www.dropbox.com/s/e1up0e7wugomt07/derby%282%29.jar?dl=0 Complete a Java program named InventoryMgr that maintains products in a database. The code to initialize the ProductDB database table and add a set of products is provided. Finish the code needed in these methods in ProductDB.java to update or query the database: purchased(int quantityPurchased) sold(int quantitytSold) getDescription() Hint: Look at the getPrice() and getQuantity() methods to see how you might write the getDescription() method’s code, and the addProduct() method to see an example of how you might write the code for the purchased() and sold() methods. Download the derby.jar file and save it where Eclipse can use it, such as on your Desktop. Download the Homework4Files.zip file containing these files: database.properties Properties file for the database connection ProductDB.java Class to update and query productdb rows InventoryDB.java Class to initialize the ProductsDB table and operate on all products InventoryMgr.java Main method with user interface SimpleDataSource.java SimpleDataSource class to simplify database connections To run the InventoryMgr Java program in Eclipse, create a new project, copy all of the Java files into the src folder of your project, and copy the database.properties file into the project’s folder. Open the Project’s Properties dialog and select Java Build Paths, then click the Libraries tab. Click the Add JARs button, use the Open dialog to find the file derby.jar, and click the Open button. Click OK to save these changes to the Project’s properties. Here is a sample run of the program – the user’s input is in green: I) Initialize database A)dd Product P)urchase Products S)ell Products C)heck Product L)list Products Q)uit I Enter 'YES' if you wish to reinitialize the inventory: YES Notice: inserted product 116-064 Toaster 50 24.95 Notice: inserted product 257-535 Hair dryer 75 29.95 Notice: inserted product 643-119 Car vacuum 43 19.99 Notice: inserted product 011-025 Gallon 2% Milk 111 2.95 I) Initialize database A)dd Product P)urchase Products S)ell Products C)heck Product L)list Products Q)uit A Enter new product code: 123-456 Enter new product description: Blender Enter new product quantity: 5 Enter new product price: 14.95 I) Initialize database A)dd Product P)urchase Products S)ell Products C)heck Product L)list Products Q)uit P Enter product code for purchase: 116-064 Product 116-064: Product: 116-064 Toaster 50 24.95 Enter number of products purchased: 5 Product 116-064 now has quantity 55. I) Initialize database A)dd Product P)urchase Products S)ell Products C)heck Product L)list Products Q)uit S Enter product code for sale: 643-119 Product 643-119: Product: 643-119 Car vacuum 43 19.99 Enter number of products sold: 3 Product 643-119 now has quantity 40. I) Initialize database A)dd Product P)urchase Products S)ell Products C)heck Product L)list Products Q)uit C Enter product code to check: 011-025 Product: 011-025 Product: 011-025 Gallon 2% Milk 111 2.95 I) Initialize database A)dd Product P)urchase Products S)ell Products C)heck Product L)list Products Q)uit q
Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here