Using Java Pluggable Components (JPC)in Oracle Forms

Java pluggable  components are java bean classes that can integrate to Oracle Forms environment and provide new functionality to the standard Forms build-in functionality.  They are used in web-centric application that are deployed through Oracle Internet Application Server.

The JPC are standard components that can be created you, or can be downloaded through the internet.

The following shows how to add JPC component to a form module and how to configure the application server accordingly.

The example explains how to add File Upload component (Note the same can be done using WebUtil)


Using Java Pluggable component

File upload example


This document assumes that the Oracle Developer is installed as the following directory


C:\oracle\product\10.1.0\DevSuite_10g      => $ORACLE_HOME



1)      Create the following file in directory at the  %ORACLE_HOME/forms/server and call it fileupload.env







Add the following to the end of the formsweb.cfg file



pageTitle=OracleAS Forms Services - FileUpload Sample
















Important:  Please note that it is very important that you set the archive variable and the archive_jini variable correctly.

In our example, the java classes (components) are located inside the demo.jar  (which is incorrectly document in the oracle documentation for the upload demo). Also note that the /formsdemo/ is a virtual directory and the actual directory is /forms/demos.  This is configured when you deploy the application.  Therefore make sure that the file demo.jar exists and located as indicated above


The variable envFile points to a the file fileupload.env, which is the file defined in step 1 above


This file defines the CLASS PATH, the FORMS path and the Oracle path.

Make sure that the form (FMX) file is located within the FORMS PATH. Note that the actual file name to be executed is defined by the variable


                  Form =   Dubai.fmx  



=====================    CODING ======================================


You need to follow coding as document in the example and the demo


Adding the code to your Form

Reusing the FileUpload utility within your own applications requires the following steps.

  1. Attach the FileUpload.pll library (shipped in the FileUpload\forms directory) to the form that needs upload capability
  2. Create a new BeanArea on one of your canvases. The bean is invisible and so you can set the size to 1x1. The BeanArea should be placed into a block with the Single Record property set to Yes. This will ensure that the bean is instanciated as soon as the Form is started. You can create a brand new block to hold the bean if you wish.
  3. Set the Implementation Class property of the new BeanArea to oracle.forms.demos.uploadclient.FileUploader
  4. Create a WHEN-CUSTOM-ITEM-EVENT trigger on the BeanArea with the code:


  1. Create a user named trigger e.g. FILEUPLOADER_CALLBACK which the upload utility will execute when the upload is complete or if the upload fails for some reason. We need this trigger because the upload is an asynchronous process, and the trigger that calls the FileUploader.UploadFile() function is not blocked until the upload is finished. A sample callback trigger might look like.

* Sample Callback trigger for FileUploader
* You should always implement a check on the status
* to make sure that the upload has worked.
* This trigger will only be executed once the upload
* has finished or aborted
 if FileUploader.getStatus = FileUploader.FINISHED then
  message(FileUploader.getSourceFile || 'was uploaded');
elsif FileUploader.getStatus = FileUploader.FAILED then
  message('Upload Failed because: '||FileUploader.getError);
 end if;

  1. Register the Bean and the Callback trigger by calling FileUploader.init(<BeanArea>,<TriggerName>). This can be done in the startup code for the form, or just before invoking an upload. However, you must call Init() before uploading. A sampl       e call to Init might look like:


  1. Finally write the code to call the upload. You can either call FileUploader.UploadFile() to display a selection dialog on the client, or FileUploader.UploadNamedFile() to upload a specific file.


Warning: If you intend to use the FileUpload utility in your own applications, We recommend that you re-sign the UploadClient PJC with your own x509 certificate.



Please follow the documents  



the entire document is downloaded from internet