Most application forms do not interact solely with a single table directly but instead select, insert, update, and delete data from multiple tables. Because multiple statements may need to be executed, the use of transactions is necessary to ensure atomicity, consistency, isolation, and durability. These four characteristics are also known as the ACID properties:
- The atomic property helps ensure that a transaction is fully complete or not started at all. If there is an error, the database should revert any changes to the start of the transaction.
- A transaction also helps to enforce consistency in the system state, meaning that the system should always be in a valid state.
- A transaction should run in isolation, meaning that it should be the only action that should be running on the system at one time. If two (or more) transactions are performing the same function simultaneously, the transaction isolation will ensure that each transaction thinks it should have exclusive use and lock on the database rows that the transaction affects.
- The durability of the transaction means that once the transaction has completed successfully, all of the changes should be permanent.
In this assignment, you will create the functionality in your CapestraApp project to create new orders. The customer for whom the order is being placed is selected from a drop-down list of all current customers. The product is selected from a drop-down list displaying all current products. Once the customer and product have been selected, the user should enter the desired quantity to be ordered. Once all of the fields have been inputted, the user can then click the Place Order button, which will call a new method called placeOrder(). This method should check to see that all fields have been filled, and it should display an error if this is not the case. Then, placeOrder() should call a similarly named method in the database interface that attempts to place the order.
- Place Order Functionality: To-Do List [DOCX].
- Capestra Furniture SRS [DOCX].
- Implementing place order functionality, part 1. | Transcript
- Implementing place order functionality, part 2. | Transcript
- Implementing place order functionality, part 3. | Transcript
- Implementing place order functionality, part 4. | Transcript
Complete these steps for this assignment.
1.In the (database interface) placeOrder() method, a transaction composed of a series of statements will need to be executed. If at any time there is an error, all of the statements should be reverted. In order, the following SQL statements must be executed:
- Check that there is enough quantity of the product to be ordered. If not, raise an exception; otherwise, continue.
- Insert a record in the order table to include the customer ID and date of the order. The date should be todays date obtained from the operating system.
- Insert a record in the order_detail table to indicate the order ID, product ID, and quantity.
- Update the product table to deduct the number of items ordered.
2. If the transaction is successful, inform the user that the order has been placed. If there was an exception, inform the user of the issue.
3. While your application is running, take screen shots of both successful and unsuccessful orders, and a screen shot of the MySQL Workbench screen showing their insertion.
- Do not capture your entire desktopjust capture the individual screens.
- Paste all screen shots into a single MS Word document.
- Your name should appear at the top of the MS Word document.
- Name your document, following this pattern: Austin_Week8.docx.
4. Create a .zip file containing your CapestraApp project.
- Before zipping your project, right-click the project and “clean” it. This greatly reduces the file size and speeds up the program’s performance.
- Then close NetBeans.
5. Add the MS Word document with your screenshots to your .zip file.
6. Submit your cleaned CapestraApp project in an appropriately constructed and correctly named .zip file.
- Rename your .zip file following this pattern: Austin_Week8zip
"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."