0% found this document useful (0 votes)
2 views

Anil's Oracle Application Framework Blog_ How to Return Array From Application Module

The blog post provides a tutorial on how to return an array from an Application Module in Oracle Application Framework. It includes sample controller and application module code demonstrating how to invoke a method and retrieve user ID and user name based on an employee ID. The code also handles exceptions and logs relevant information during execution.

Uploaded by

Hussein Wassof
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Anil's Oracle Application Framework Blog_ How to Return Array From Application Module

The blog post provides a tutorial on how to return an array from an Application Module in Oracle Application Framework. It includes sample controller and application module code demonstrating how to invoke a method and retrieve user ID and user name based on an employee ID. The code also handles exceptions and logs relevant information during execution.

Uploaded by

Hussein Wassof
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2/21/25, 1:54 PM Anil's Oracle Application Framework Blog: How to return array from Application Module

Anil's Blog is Best Viewed on GOOGLE CHROME


More

Anil's Oracle Application Framework Blog


Sharing learning with wider audience
Home ADF How to start learning OAF Extensions in OAF Trainings & Services Jobs

Google Ads Friday, April 10, 2009 Goog

How to return array from Application Module


Controller Code

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import oracle.apps.fnd.framework.OAException;

Serializable paras[] = {employee_id};


Object result[] = new Object[10]; // declaring result of Array Type
result = (Object[])am.invokeMethod("getparameters", paras); // Calling AM Method

String userid = (String)result[0]; // Capturing value from Array


String userName = (String)result[1]; // Capturing value from Array

Application Module Code

public Object[] getparameters(String employeeid)


{
ResultSet resultset = null;
int employee_id = Integer.parseInt(employeeid);

Object result[] = new Object[10];


OADBTransaction oadbtransaction = getOADBTransaction();
Debug.write(oadbtransaction, this, "Employee id is " + employee_id, 1);

try
{
Connection conn = getOADBTransaction().getJdbcConnection();
Contact Me String query = "sselect user_id, user_name from fnd_user where employee_id=:1";
Sele
Power
Contact Me! PreparedStatement stmt = conn.prepareStatement(query);
stmt.setInt(1, employee_id);

for(resultset = stmt.executeQuery(); resultset.next(); Disc


Followers {
The v
Followers (148) Next reflec
result[0] = resultset.getString("user_id");
comp
Debug.write(oadbtransaction, this, "Project Number is " + result[0], 1);
work
Corp
result[1] = resultset.getString("user_name");
Debug.write(oadbtransaction, this, "Project ClassCode is " + result[1], 1); The o
on th
} free t
} am n
happ
incon
catch(Exception e)

{
Debug.write(oadbtransaction, this, "Exception " + e.getMessage(), 1); Sear
}
return result; // Returning result array to Controller
Follow
}

Sear
Find us on Facebook Posted by Anil Sharma at 11:15 AM

No comments:
https://oracleanil.blogspot.com/2009/04/custrespco-wf.html 1/4
2/21/25, 1:54 PM Anil's Oracle Application Framework Blog: How to return array from Application Module

Blog Archive Post a Comment Our

► 2020 (1) Note: Only a member of this blog may post a comment.

► 2019 (7) To leave a comment, click the button below to sign in with Google.
► 2016 (2)
SIGN IN WITH GOOGLE
► 2015 (1)

► 2014 (6) Visit

► 2013 (5)
► 2012 (2) Newer Post Home Older Post
► 2011 (7)

► 2010 (24) Subscribe to: Post Comments (Atom)

▼ 2009 (44)
► May (14)
▼ April (30) Labe
RADIO
GROUP .rcx (
EVENT
Array
TO Find @ in Calling
column Row (
date (
Setting
WhereClau DFF
se in Duplic
VOImpl FirePa
(1) Jd
The JDBC Login
Tutorial: Page
Chapter 3 - Read
Advanced Acces
Tutorial table t

Important
Profile
Options in
OAF
Onion
Architectur
e of OA
Framework
How to
capute
current row
in Table
Region
How to
compare
two dates
Prepared
Statement
- Controller

Callable
Statement
in
Controller
How to return
array from
Application
Module
Creating VO
at
RunTime
in
Controller
OR
Dynamicall
...
Getting &
Setting
Value
Convert
dateToStrin
g|
stringToDat
e

https://oracleanil.blogspot.com/2009/04/custrespco-wf.html 2/4
2/21/25, 1:54 PM Anil's Oracle Application Framework Blog: How to return array from Application Module

https://oracleanil.blogspot.com/2009/04/custrespco-wf.html 3/4
2/21/25, 1:54 PM Anil's Oracle Application Framework Blog: How to return array from Application Module

Copy Restricted

Copyright © 2010 Anil's Blog. All rights reserved.. Awesome Inc. theme. Powered by Blogger.

https://oracleanil.blogspot.com/2009/04/custrespco-wf.html 4/4

You might also like