1

I need to call a Stored Procedure running in DB2.Since the Oracle DB Adapter Doesnt support DB2 , I have used Java Embedding to call the Stored Procedure . I Dont have a problem in Calling the Stored procedure using Java Embedding and getting the result Set.The problem starts when is start assinging the result set to the output variable .I use the below snipped to set the variable.

rset=statement.executeQuery("SELECT name, number, salary from Employee");
rset = statement.getResultSet();
int j=1;
 if (rset != null)
{
while(rset.next())
{
    name=rset.getString("name");
    name=rset.getString("number");
    name=rset.getString("salary");
    setVariableData("temp","payload","/ns1:code1["+j+"]/ns1:empname",name); 
    setVariableData("temp","payload","/ns1:code1["+j+"]/ns1:empno",number);
    setVariableData("temp","payload","/ns1:code1["+j+"]/ns1:salary",salary); 
        j=j+1;
}
}

In the above mentioned Code I expect to display all the empname,number and salary details of all the employees to be assigned to output variable temp .But the output i see is only the last employee details .The remainin employee details are not shown .If i replace the variable j with either 1 or 2 or 3 etc i get the output of only that array element details whereas other details are not known .Can someone help me in getting the whole result set to a output variable .

Sathish
  • 11
  • 1
  • Which BPEL solution are you using? Why don't you use a jdbc jca adapter outside your BPEL? – Franch Sep 13 '11 at 12:14
  • I am using 10.1.3.5 SOA version .Its a requirement to use only BPEL resources Hence no JDBC jca adapter :( – Sathish Sep 14 '11 at 06:25
  • Ok so you use Oracle SOA suite 10.1.3.5, how your output type (BPEL variable) has been defined? – Franch Sep 14 '11 at 08:38
  • Normal Output variable with a Schema to get which has a code1 as root element and Employee Name ,Number and Salary as Child Elements .The code1 Rool Element is unbounded . – Sathish Sep 15 '11 at 03:03

1 Answers1

0

Have you tried to create the "/ns1:code1["+j+"] element before setting is sub element ?

I foudn this issue report :

http://oraclefusion1011.blogspot.com/2011/01/issue-with-setvariabledata-in-java.html

Franch
  • 175
  • 2
  • 14