tell me more icon Creating a Java Class

To follow along with the example, in this step and throughout the cards, enter values as shown in the instructions. Then you will be able to follow the steps in the cue cards exactly as written.

Before you can create a web service data control, you have to create Java classes from which a session bean will be generated. In the example, you will create three Java classes. The Java classes contain JavaBean properties, fixed sets of constants for customer codes and freight destinations, and a method to calculate a customer discount. The session bean method calculates the freight cost based upon a customer code and a destination. Later you will use a wizard to generate an EJB web service from the session bean.

New classes can be created and added to your project after you build the initial application and project. To begin creating a Java class, you will open the Create Java Class dialog. To open the dialog, in the Application Navigator, right-click the project and choose New . In the New Gallery, select General in the Categories tree and Java Class in the Items list, then click OK.

New Gallery, General category items

Then, in the Create Java Class dialog, you will specify the class name and the package name.

Create Java Class dialog

When you create a class in JDeveloper, the class is added to the active project. You can immediately begin editing the class file in the source editor.

Java source editor with generated code

Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,