Blog / Build and Run Our Client Project to Update and Delete Faculty Record via Web Service – Develop Java Web Services to Access Databases

Build and Run Our Client Project to Update and Delete Faculty Record via Web Service – Develop Java Web Services to Access Databases

Build and Run Our Client Project to Update and Delete Faculty Record via Web Service – Develop Java Web Services to Access Databases


9.12.4  Build and Run Our Client Project to Update and Delete Faculty Record via Web Service

Prior to building and running our client project to consume our Web Service project, make sure that our Web Service application project, WebAppFaculty, has been successfully built and deployed to make it ready to be called by the client project.

Click on the Clean and Build Main Project button to build our client project. If every-thing is fine, click on the Run Main Project button to run our client project.

The FacultyFrame form window is displayed. First let’s perform a faculty query action. Select a desired faculty member, such as Ying Bai, from the Faculty Name combo box and click on the Select button to query the detailed information for this faculty via our Web service WebServiceFaculty. The queried result is displayed in seven text fields and the PictureBox with the selected faculty image.

Now enter a updated faculty record with the following six pieces of updated faculty information into six text fields, shown in Figure 9.62.

Name:Michael Bai
Title:Assistant Professor
Office:MTC-200
Phone:750–378–2000
College:Stanford University
Email:[email protected]

Click on the Update button to browse and select the desired updated faculty image; in this case, it is Michael.jpg, and then try to call our Web service operation, UpdateFaculty(), to update this faculty record in our sample database. Keep our project running and do not terminate it.

To confirm the data update action, two methods can be used. First we can use the Select but-ton to retrieve the updated faculty record from our sample database to confirm the update action. To do that, go to the Faculty Name combo box, and you can see that the updated faculty name, Michael Bai, has been added into this box. Click this name to select it and click on the Select button. You can find that six pieces of updated faculty information have been retrieved and dis-played in this form window, as shown in Figure 9.63. Our data update is successful!

FIGURE 9.62   Six pieces of updated faculty information.

FIGURE 9.63   The updated faculty information.

FIGURE 9.64   The opened Faculty Table in the NetBeans IDE.

The second way to confirm the data update action is to open our Faculty Table using either the Services window in the NetBeans IDE or the Oracle SQL Developer to check whether the fac-ulty record has been updated. To do that using the Services window in the NetBeans IDE 12.0, perform the following operations:

1) Open the Services window and expand the Databases node.
2) Right-clickonourOracledatabaseURL:jdbc:oracle:thin:@localhost:1521:XE;, and select the Connect item to try to connect to our database. Enter oracle _ 18c into the Password box and click on the OK button.

3) Expand our sample database, CSE _ DEPT, and Tables.
4) Right-click on the Faculty Table and select the View Data item.

Angela Gaffney

  • 0

Leave a Reply

Your email address will not be published. Required fields are marked *


                Copyright © 2024 Saucierlight.com. All Rights Reserved.