0% found this document useful (0 votes)
2 views6 pages

Running a Java Concurrent Program in Oracle Apps

The document outlines the process of running a Java concurrent program in Oracle Apps, detailing the use of the runProgram(CpContext) method for embedding code. It includes a sample Java code for a class implementing JavaConcurrentProgram, instructions for compiling the program using Putty, and steps for executing the program through Oracle Apps. Finally, it describes how to view logs and outputs after submitting the request in the application developer interface.

Uploaded by

hari
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Running a Java Concurrent Program in Oracle Apps

The document outlines the process of running a Java concurrent program in Oracle Apps, detailing the use of the runProgram(CpContext) method for embedding code. It includes a sample Java code for a class implementing JavaConcurrentProgram, instructions for compiling the program using Putty, and steps for executing the program through Oracle Apps. Finally, it describes how to view logs and outputs after submitting the request in the application developer interface.

Uploaded by

hari
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Running a Java Concurrent Program in Oracle Apps

Oracle provides an interface with a method called runProgram(CpContext), which is


where you need to embed your code. This method is called from a main thread after
program start and initialization. The CpContext passed as a parameter to this
method – and hence to your code – provides access to many of the variables needed
to complete your solution, like .log and .out files and a JDBC connection to the
database where this program will be run.

To be able to run your program, you need to define a Concurrent Executable and
Concurrent Program and provide some indication of where your code resides.
Assuming you already know how to define a Program and Executable, I will cover the
registration process for the path to your program.

Write the below Code in your favourite Editor

package [Link]; //You will get the class file in the specified location

import [Link];

import [Link];

import [Link];

import [Link].*;

import [Link].*;

import [Link].*;

public class TestJCP implements JavaConcurrentProgram {


OutFile out;

LogFile log;

public void runProgram(CpContext ctx) {

Connection conn = null;

try {

out = [Link]();

log = [Link]();

ParameterList parms = [Link]();

conn = [Link]();

int userId = [Link]().getUserInfo().getUserId();

// insert your code here

[Link]("Hello World", 0); //WRITES IN LOG

[Link]("Hello World"); //GIVES THE OUTPUT

[Link]().setCompletion([Link], "Completed.");

} catch (Exception e) {

[Link]("Exception during PPS Reconciliation...\n" + [Link]());

[Link]().setCompletion([Link], "Completed.");

} finally {

try { [Link](); } catch (SQLException e) {}

}
Now open the tool to connect with oracle Server

The Tool I use is Putty

Login and insert the following command to compile the program

javac –d $JAVA_TOP [Link]

The above command compiles and gives a class file to $JAVA_TOP

Now your output class will be in the available in the below path $JAVA_TOP/oracle/apps/tech

The above path name comes due to package path in the Java program

Now the Compiled program has to be executed.

We can execute the program by creating a executable in oracle apps

Go to Application Developer -> Concurrent -> Executable


Go to Application Developer -> Concurrent -> Program
Now go to your responsibility and create a request

Get Your request Group from the Responsibility and attach the concurrent program

Now go to your Responsibility and now Submit the Request


Now Click the View Log and View output.

You might also like