Creating a Java Class in JDeveloper

The first step in building a Java application is to create a Java class. The following instructions describe how you create a class called DataHandler, which will contain the methods for querying the database and modifying the data in it.

  1. In the Application Navigator, right-click the View project, and from the shortcut menu, select New.
  2. In the New Gallery dialog box, select General in the Categories list. In the Items list, select Java Class, and click OK. The Create Java Class dialog box is displayed.
  3. In the Create Java Class dialog box, enter DataHandler in the Name text box, and hr in the Package text box. Do not change the default values of the Optional Attributes, and click OK. The Create Java Class dialog box with the appropriate values specified is shown in Figure 3-4.

    Figure 3-4 Creating a Java Class

    Description of Figure 3-4 follows
    Description of "Figure 3-4 Creating a Java Class"
  4. The skeleton DataHandler class is created and is displayed in the Java Source Editor. The package declaration, the class declaration, and the default constructor are created by default. Figure 3-5 shows the class displayed in the Java Source Editor, ready for you to add your Java code:

    Figure 3-5 Java Source Editor

    Description of Figure 3-5 follows
    Description of "Figure 3-5 Java Source Editor"