Skip to content

Build Code for the Insert Button Event Handler to Insert a New Course – ORACLE DATABASE PROGRAMMING WITH JAVA

Menu
  • Contact Us
Menu

Build and Run Our Client Project to Query Course Record via Our Web Service 4 – Develop Java Web Services to Access Databases

Posted on 2022-10-262024-08-24 by Patricia Carey

Prior to building and running our client project, make sure that our Web Service application project, WebAppCourse, has been built and deployed successfully.

Perform the following operations to build and run our client project, WebClient Course _ Insert:

  1. Click on the Clean and Build Main Project button to build our project.
  2. Then click on the Run Project button (green arrow) on the top to run our project.

When the project runs and the course page is opened, enter a valid faculty name, such as Ying Bai, into the Faculty Name box, and then click on the Select button to query all courses (course _ id) taught by this faculty member. All four courses (course _ id) should be retrieved from our database and displayed in the CourseList box, as shown in Figure 9.106.

Let’s test inserting a new course record into the Course Table in our sample database. Keep the selected faculty member, Ying Bai, with no change and enter the following six pieces of informa-tion as a new course record into the six related TextFields in this course page:

•Course ID:CSE-565
•Course Name:Machine Learning
•Schedule:T-H: 9:30–10:45 AM

FIGURE 9.107   The confirmation result of the new inserted course record.

•Classroom:TC-202
•Credit:3
•Enrollment:16

Click on the Insert button to try to insert this new course record into the Course Table in our sample database, CSE _ DEPT. If this insertion action is successful, the client page Course.jsp is refreshed to clean all contents to null in each TextField.

To check the data insertion, just click on the Select button to retrieve all courses (course _ id) taught by the selected faculty member, Ying Bai. One can see that the new inserted course, CSE-565, is retrieved and displayed in the CourseList box, as shown in Figure 9.107.

Select this new inserted course from this CourseList box by clicking on it, and then click on the Details button to get details for this course record. The details about this new inserted course are displayed in six

TextFields, as shown in Figure 9.107. Our data insertion with our Web client project is successful! Click on the Back and the Exit buttons to close our project.

Another way to confirm the data insertion is to open the Course Table via the Services win-dow in the NetBeans IDE. After opening the Services window, expand the Databases icon and connect to our sample database by right-clicking on our database URL. Select the Connect item and enter the password, oracle _ 18c, to connect to our sample database. Then expand our database, CSE _ DEPT, and Tables folders, right-click on the COURSE Table and select the View Data item to open this Table. One can see that the new course is really inserted into the Course Table; it is located on the bottom line that has been highlighted, as shown in Figure 9.108.

Next let’s build and develop the code for our client project to access our Web Service to update a selected course in our Course Table.

Leave a Reply Cancel reply

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

  • August 2024
  • April 2024
  • March 2024
  • January 2024
  • September 2023
  • May 2023
  • January 2023
  • October 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • January 2022
  • November 2021
  • September 2021
  • July 2021
  • May 2021
  • March 2021
  • January 2021
June 2025
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Aug    
  • Creating the Catalog Database
  • Creating the Shard Catalog
  • Exams of Oracle
  • GDS Components
  • GDS Restrictions, License, and Compatibility
  • Oracle Certification Exams
  • Oracle Sharding Workshop
  • Build Code for the Insert Button Event Handler to Insert a New Course 2 – Develop Java Web Services to Access Databases
  • Build Code for the Insert Button Event Handler to Insert a New Course – Develop Java Web Services to Access Databases
  • Build Code for the Update Button Method to Update Course Records – Develop Java Web Services to Access Databases
  • Build Code for the Update Button Method to Update Course Records 2 – Develop Java Web Services to Access Databases
  • Build Code for the Delete Button Method to Delete Course Records – Develop Java Web Services to Access Databases
© 2025 Build Code for the Insert Button Event Handler to Insert a New Course – ORACLE DATABASE PROGRAMMING WITH JAVA | Powered by Minimalist Blog