Clayton State University Week 7 Data Base for Customer Information MySQL Program
Question Description
overview:
Applications require some form of interaction to add content. The simplest form is to have a mapping of a form set of input fields such as “customer” to insert directly into one table. This reduces the complexity of the functionality because not much more has to be performed. It is important to plan what needs to be done when an event occurs beyond just the insert, including what should happen to the form fields, how the user is notified, what has been performed, and whether there are any errors. In this assignment, you will create the functionality to create new customers. Using the screen that has been designed, ensure that you have created the labels, input fields, and buttons to add a customer. Each data field in the customer database table should have an input field defined other than the primary key that is auto-incremented.
For this assignment, you will create an event handler to execute when the user presses the Add Customer button to call a new method called addCustomer(). This method should retrieve the input data from the form and pass the data to another method in CapestraDB. By convention, this new method in CapestraDB also is named addCustomer(). In this new method, the database should be connected first to a database account that has permission to insert into the table. The customer data from the input fields should be populated into an INSERT statement and then executed to be inserted into the database. If the INSERT statement was successful, clear the input fields and inform the user that the customer has been added. If the INSERT was not successful, inform the user that there was an error without clearing the input fields. It may help as you develop your methods to test a single input field all the way from the input to insertion into the database and then add in the rest of the input fields.
Review the SRS to read about additional details regarding this Action. For example, the user should be informed if any of the customer information is missing (and no insertion should be made). And if the customer already is in the database, an error message should be displayed (and no insertion should be made). Note: A customer is identified by first name and last name.
Note that in this assignment and in all future assignments, you are required to use the provided CreateOES.sql script to (re-)create your MySQL database. This script (and the database that it creates) replace the database that you created in previous assignments. Your MySQL environment must have a root user and the root password must be root.
Assignment Instructions
Complete the following steps for this assignment:
- Implement the feature in your CapestraApp project to create a new customer to the database based on input from the Add Customer screen.
- Issue appropriate error messages if some or all of the customer data are missing.
- Create an INSERT statement that adds a unique customer to the database.
- Create a confirmation message telling whether the insertion was successful and the name of the added customer.
- Display an error message if an attempt is made to create a duplicate customer.
- Check the database to confirm that the customer record has been inserted.
- Clear all input fields in the screen after a successful insertion; dont clear them if there is any error.
- While your application is running, take screen shots of both successful and unsuccessful customer additions and a screen shot of the MySQL Workbench screen showing the inserted customers.
- 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_Week7.docx.
- 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.
- Add the MS Word document with your screenshots to your .zip file.
- Submit your cleaned CapestraApp project in an appropriately constructed and correctly named .zip file.
- Rename your .zip file, following this pattern: Austin_Week7.zip.
Deliverable
References:
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."