Creating the J2C bean for the Oracle native API application

This topic outlines the steps to create and run the complete Oracle EBS native API application.

Procedure

  1. Select File > New > Other > J2C.
  2. Select J2C bean, and click Next.
  3. On the Resource Adapter Selection page, select Oracle > IBM WebSphere Adapter for Oracle E-Business Suite (IBM:7.0.0.0_IF02) > CWYOE_OracleEBS, and click Next.
  4. On the Connector Setting page, beside the Oracle JDBC driver field, click Add. Browse to the directory on your file system where ojdbc6.jar is located and click Open. Click Next.
  5. On the Adapter Style page, click Outbound, and click Next.
  6. On the Discovery Configuration page, provide the values for your connection to the Oracle connection, and click Next.
    • In the JDCB driver type field, select Oracle Thin Driver
    • In the System ID field, type your system id.
    • In the Host name field, type the url or IP address of your database.
    • In the Port number field, type your port number.
    • In the User name field, type your username.
    • In the Password field, type your password.
    Connection information
  7. In the Object Discovery and Selection page, click Edit Query. In the Query Filter Parameter page:
    1. In the Schema name or pattern field, type APPS.
    2. In the Supported database object types field, press CTRL + select Tables, Views, and Synonyms - Nick Names, and click Remove.
    3. Select Prompt for additional configuration settings when adding business object, and click OK.
      Edit query page
    Click Execute Query. In the Objects discovered by query field, select APPS > Stored Procedures, Without expanding Stored Procedures, click Create or edit filter:
    Create or edit filter
    1. In the Filter Properties for 'Stored Procedures' page, in the Object name or pattern field, type EXECUTABLE, and click OK.
      Stored procedure
    2. Expand Stored Procedures subcategory. Because of the large number of procedures contained in the APPS schema, it may take a long time for the adapter to return the list of Stored Procedures.
    3. Select EXECUTABLE(FND_PROGRAM) from the list of stored procedures, and click Add selected discovered objects to selected objects, and the Configuration Parameters for EXECUTABLE(FND_PROGRAM) page appears. Click OK, and on the Object Discovery and Selection page, click Next.
      Configuration Parameters for EXECUTABLE (FIND_PROGRAM)
  8. On the Configure Composite Properties page, use the default namespace in the Business object namespace field and in the Specify the relative folder for generated business objects field, type a name for the folder where you want the generated business objects to be stored, and click Next.
    Configure composite properties page
  9. In the New J2C page,
    1. beside the Project name field, click New.
      1. On the New Source Project Creation page, select Java project, and click Next
      2. On the Create a Java™ Project page, in the Project name field, type NativeAPI, and click Next.
      3. On the Java Settings page, click Finish.
    2. In the Package name field, type nativeapi.executable.
    3. In the Interface field, type EBSAPI.
    4. In the Implementation field, In the Implementation field, accept the default value EBSAPIImpl, or type an implementation name.
    5. In the Connection properties field, clear Managed connection and select Non-managed connection. In the database connection information field, select Specify local database connection information, and click Finish.
    The following projects have been added to your workspace:
    generated projects
  10. Right-click the NativeAPI project and select New > Package. On the Java package page, in the Namefield, type client, and click Finish.
  11. Right-click the client package that you just created, and select New > Class. On the Java Class page, in the Name field, type ApplicationClient and click Finish. Right-click the ApplicationClient class and select Open With > Java Editor. Select all the code, and replace it with this:
    package client; 
    
    import javax.resource.ResourceException; 
    
    import com.ibm.xmlns.prod.websphere.j2ca.oracle.appsfnd_programu46executable.AppsFnd_ProgramU46executable;
    
    import nativeapi.executable.EBSAPI; 
    import nativeapi.executable.EBSAPIImpl;
     
    
    public class ApplicationClient { 
    	
    	public static void main(String[] args) {
    		try { // Create input instance of java data binding 
    			AppsFnd_ProgramU46executable inputData = new AppsFnd_ProgramU46executable(); 
    			// Create output instance of java data binding 
    			AppsFnd_ProgramU46executable outputData = null; 
    			// Populate input data 
    			inputData.setapplication("AR"); 
    			inputData.setexecutable("IBMSAMPLENAME1"); 
    			inputData.setexecution_file_name("TEST_PACKAGE.TEST_PROCEDURE"); 
    			inputData.setexecution_method("PL/SQL Stored Procedure"); 
    			inputData.setlanguage_code("US"); 
    			inputData.setshort_name("IBMSAMPLENAME1"); 
    
    			// Create instance of the J2C Java Bean 
    			EBSAPI storedProcedure = new EBSAPIImpl(); 
    			// Invoke executable program using adapter 
    			outputData = storedProcedure.executeAppsFnd_ProgramU46executable(inputData); 
    			// Print returned subroutine name 
    			if(outputData != null) 
    				System.out.println(outputData.getsubroutine_name()); 
    			} 
    		catch (ResourceException e) { 
    			System.out.println("Exception during execution: " + e.getMessage()); 
    		}
    	}
    }
  12. Press CNTR + S to save.

Results

Running the ApplicationClient class:

Right-click the ApplicationClient class, and select Run As > Java Application.

Verify the results using the Oracle EBS web client:

Feedback