hw
JSP and MySQL Assignment
1. Create a database called premiergardens2 using MySQL.
2. Create a table inventory in the premiergardens2 database.
3. Create the following fields for the inventory table – toolid CHAR(5) (Primary Key), toolname CHAR(30), wholesale DECIMAL(7,2), retail DECIMAL(7,2), sold INTEGER, and inventory INTEGER.
4. Create a front-end HTML form, insertinventory.html, with text fields that will allow you to enter the following data into the inventory table. Do not hard code this information. Please insert one record at a time in the inventory table using a JSP script inserttools.jsp.
toolid
toolname
wholesale
retail
sold
inventory
TS234
Tractor Scooter
85.03
97.95
122
26
GH178
Greenhouse
82.19
119.59
9
155
ED829
Edger
83.22
115.99
55
115
HS398
Hot Stick
212.44
318.99
26
75
PS098
Pole Saw
226.99
342.95
33
15
5. Write a JSP script, displaytools.jsp, that will display all of the records in the inventory table.
6. Create a front-end HTML form that simulates the sale of tools, selltools.html.
7. Write a JSP script, toolsales.jsp, that will run one update query for sold and a second update query for inventory. Thus, when the user selects an item, decrement the number of items in inventory and then increment the number of items sold.
8. Run the script created in step 5. to verify that the values are updated.
9. Create a front-end HTML form, profits.html, that will have radio buttons that will allow the users to query the database table.
a. Show the total profit and number sold for the tractor scooter.
b. Show the total profit and number sold for greenhouse.
c. Show the total profit and number sold for edger.
d. Show the total profit and number sold for hot stick.
e. Show the total profit and number sold for pole saw.
f. Show the total profit and number sold for all items.
10. Write a JSP script gardenprofits.jsp. You must run a different SELECT query for each tool. The profit is computed as sold * (retail – wholesale).
code
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. If we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency and level of study. If you want a cheap essay, place your order with as much time as possible. Our prices start from $11 per page.