Question :
I am working on a legacy project that is using Oracle Forms 6i (yes, I know its old) to call C++ functions from a PLL library.
Now we need to use Java instead of C++, therefore we need to call Java (Object/Class/Method) from Oracle Forms.
I know its a challenging subject, but I would be really happy if someone could provide a simple example that does the following:
I know some PL/SQL, but I am not a Oracle Forms developer; please bear with me.
If this is not possible, could you point me to some other alternatives?
Answer :
I am working on a legacy project that is using Oracle Forms 6i (yes, I know its old) to call C++ functions from a PLL library.
Now we need to use Java instead of C++, therefore we need to call Java (Object/Class/Method) from Oracle Forms.
I know its a challenging subject, but I would be really happy if someone could provide a simple example that does the following:
- Invoking a method from the Java class, passing a int variable (within PL/SQL)
- Printing the returned value in the Canvas that executed the Function.
I know some PL/SQL, but I am not a Oracle Forms developer; please bear with me.
If this is not possible, could you point me to some other alternatives?
Answer :
Well, after an intensive lookup through the internet I came across a very good resource (in Spanish though): Elias blog about Oracle Forms and Java
I use:
Configure PATH environment variables:
Add to CLASSPATH
Create Java Program
Import the classes to FormsCreate a new project in Oracle Forms and also create a Canvas, in the canvas use a Text and a Button. The name of the button: TEXT_HI_WORLD.Following click on the Menu: Program > Import Java Classes If everything went Ok then there will be a new window that will show you the package where the Class is, you extend it until there is the HiWorld class. Import it. In Program Unit now there will be two files:
Then go back to the canvas, right click on the Button and select the Thrigger WHEN-BUTTON-PRESSED, the programming of this will be:
Now execute the program and click on the button! :)Hope this helps Java programmers with no much of knowledge on Forms to integrate with legacy systems! :D |
0 comments:
Post a Comment