6.3.8 Perform the Data Query for the Course Table
The function of this CourseFrame Form is to allow users to get all courses taught by the selected fac-ulty member and detailed information for each course. First, all courses, that is, all course _ id values, taught by the selected faculty member from the Faculty Name combo box will be displayed in the Course ID List list box when the user clicks on the Select button. Second, detailed infor-mation for each course (course _ id) selected from the Course ID List box will be displayed in six text fields as each course _ id is clicked by the user.
Let’s modify the project OracleSelectFaculty and make it our new project, OracleSelect Course. Just right-click that project, and select Copy item. Then enter OracleSelectCourse in the Project Name box in the opened Copy Project wizard, and click on the Copy button.
Now open our new project, OracleSelectCourse, in the Projects window. In this section, only two buttons, Select and Back, are used for the CourseFrame Form to get course data, and other buttons will be used later for data-manipulating query actions.
The code development in this section can be divided into the following five parts:
1) Importing the necessary Java packages and building code for the constructor of the CourseFrame class to perform the initialization processes.
2) Building the Java package named FacultyCourse via Oracle SQL Developer.
3) Coding for the Select button Click event handler to perform a CallableStatement query to run a stored procedure to query data from the Course Table in our sample database.
4) Coding for the CourseList box to handle an event when a course _ id in the CourseList box is selected to display the detailed information for that course _ id in six text fields.
5) Coding for the Back button Click event handler to close the CourseFrame Form win-dow and return control to the SelectionFrame Form.

FIGURE 6.40 The code for the constructor of the CourseFrame class.