7.3.3 Build and Run the Project to Test the Data Update
Click on the Clean and Build Main Project button from the toolbar to build our project.
Then click on the Run Main Project button to run the project.
Enter a suiTable username and password, such as jhenry and test, to complete the login pro-cess and select Faculty Information from the SelectFrame window to open the FacultyFrame win-dow. Make sure that the Runtime Object Method has been selected from the Query Method combo box. Then click on the Select button to query any faculty information. As an example, here select the faculty member Ying Bai from the ComboName box and display all pieces of informa-tion for this example faculty member.
To update this faculty record, enter the following information into six Text Fields (no Faculty ID Text Field) in the Faculty Information panel as an updated faculty record:
• | Faculty Name: | Susan Bai |
• | Title: | Professor |
• | Office: | MTC-218 |
• | Phone: | 750–378–1248 |
• | College: | Duke University |
• | Email: | [email protected] |
Click on the Update button to select a desired image for this updated faculty member, such as White.jpg. All example faculty image files, including this faculty image, can be found in the folder Students\Images\Faculty on the CRC Press ftp site (refer to Figure 1.2 in Chapter 1). You can copy and paste those image files to your desired folder on your computer.
Now, if you go to the Faculty Name combobox, ComboName, it can be seen that the updated fac-ulty name, Susan Bai, has been added into the Faculty Name combobox, and the original faculty member, Ying Bai, has been removed from this box.
One way to validate this data update is to go to the Output window. You can find that a success message is displayed in that window, as shown in Figure 7.12.
Similar to the data insert action, here we have another two ways to validate the data update. One way is to open our Faculty Table in our sample database to confirm the data update, and the other way is to use the Select button (that is, the code inside that button’s click event handler). We prefer to use the second way. Click on the Select button to try to retrieve this updated faculty record, and the run result is shown in Figure 7.13. Our data update action is successful!
FIGURE 7.12 The successful data update message.
FIGURE 7.13 The data update result.
It is highly recommended to recover the updated faculty record to the original one to keep our database clean and neat. One can perform a similar update action to do this recovery job. Of course, you can also perform this data recovery job by using the Oracle SQL Developer if you like.
Next let’s handle the data deletion action against our sample database.