Blog / Deploy and Test the Web Service Project 2 – Develop Java Web Services to Access Databases

Deploy and Test the Web Service Project 2 – Develop Java Web Services to Access Databases

Deploy and Test the Web Service Project 2 – Develop Java Web Services to Access Databases


Recall that when we built our sample Oracle database, CSE _ DEPT, in Chapter 2, we created all original columns in different Tables for an original faculty record. For example, for an original faculty member, Ying Bai, we setup a faculty _ id related to that member in the LogIn Table and detailed information with eight columns in the Faculty Table, some columns in the Course Table and some courses in the StudentCourse Table. These columns made some relationships via primary or foreign keys. If this kind of faculty record were deleted from the Faculty Table, all other related columns in other Tables would also be deleted.

Recalled that a cascaded update and delete relationship among our five Tables was established when we built our sample database in Chapter 2. Therefore, if an original faculty record, such as Ying Bai, were deleted from the Faculty Table, not only would that single faculty record be deleted from the Faculty Table but all columns related to that faculty member in other Tables, such as the LogIn, Course and StudentCourse, would also be deleted because of this cas-cade relationship.

If that kind of delete action is performed, it is highly recommended to recover the deleted faculty and related records in our Faculty, LogIn, Course and StudentCourse Tables. An easy way to do this recovery is to use records shown in Tables 9.1–9.4 and follow these steps:

1) First run either the WinClientFaculty _ Insert or WebClientFaculty _ Insert project to insert the deleted faculty record shown in Table 9.1.

2) Use the Oracle SQL Developer to add the related records shown in Tables 9.2~9.4 one by one manually.

The order of these operations is very important when doing the recovery, since the Faculty Table is a parent Table and the faculty _ id of the deleted faculty record is a primary key in the Faculty Table. Thus, the faculty record must be recovered prior to recovering any other records in any other Tables.

Next we can develop a client project to consume this Web service to perform data update and delete actions to the Faculty Table in our sample database. First let’s discuss how to build a Window-based client project to consume our Web service.

Angela Gaffney

  • 0

Leave a Reply

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


                Copyright © 2024 Saucierlight.com. All Rights Reserved.