Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

REST API in Oracle Form

I am following the threads here on REST APIs and have found the most recommended way is to jar a java file and place it in the CLASSPATH of default.env. Then, upon opening Oracle Form Builder, we should find that jar. However for me that is not the case.

I am currently using Oracle Forms 12.2.1.4. This is the java file i have created following the examples in Oracle Forum. I then made it into a jar called RestClient.jar

package frmRest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class RestClient {

public static String makeCall(String endpoint) throws Exception {
HttpURLConnection connection = null;
BufferedReader reader = null;
StringBuilder result = new StringBuilder();

try {
URL url = new URL(endpoint);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");

reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
result.append(line);
}

} catch (IOException e) {
throw new Exception("Error calling REST service: " + e.getMessage());
} finally {
if (reader != null) {
reader.close();
}
if (connection != null) {
connection.disconnect();
}
}
return result.toString();
}
}

Then i moved the jar file to
K:\Oracle\Middleware\user_projects\domains\alioracle_domain\config\fmwconfig\components\FORMS\forms1\java

and then i edited my default.env of CLASSPATH to be this now

CLASSPATH=K:\Oracle\Middleware\user_projects\domains\alioracle_domain\config\fmwconfig\components\FORMS\forms1\java\RestClient.jar;K:\Oracle\Middleware\jlib\importer.jar;K:\Oracle\Middleware\jlib\frmbipc.jar;K:\Oracle\Middleware\forms\j2ee\frmsrv.jar;K:\Oracle\Middleware\forms\provision\frmconfig.jar;K:\Oracle\Middleware\jlib\ldapjclnt11.jar;K:\Oracle\Middleware\jlib\debugger.jar;K:\Oracle\Middleware\oracle_common\jlib\ewt3.jar;K:\Oracle\Middleware\oracle_common\modules\oracle.bali.share\share.jar;K:\Oracle\Middleware\jlib\utj.jar;K:\Oracle\Middleware\jlib\zrclient.jar;K:\Oracle\Middleware\reports\jlib\rwrun.jar;K:\Oracle\Middleware\forms\java\frmwebutil.jar;K:\Oracle\Middleware\forms\java\frmRest.jar

my default.env is located in K:\Oracle\Middleware\user_projects\domains\alioracle_domain\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_12.2.1\config

When i started all of my Oracle Forms Services, and ran Oracle Form builder, these are my only options. Did i do something wrong?

This post has been answered by Michael Ferrante-Oracle on Oct 23 2024
Jump to Answer
Comments
Post Details
Added on Oct 23 2024
6 comments
127 views