Hi,
I am using DB2 v8.2 & jdk 1.4.
1. I have a java program which returns an array which contains 1 to 5
numbers.
The code:
public class ArrayTest
{
public static final int ARRAY_SIZE = 5;
public static int[] array()
{
int array[] = new int[ARRAY_SIZE];
for(int i = 0; i < ARRAY_SIZE ; i++)
{
array[i] = i+1;
}
return array;
}
public static void main(String params[])
{
int a[] = array();
for(int i = 0; i < a.length ; i++)
{
System.out.println(a[i]);
}
}
}
2. Now, I need to catch that values returned by java using a function /
stored procedure in DB2
3. Using the values caught, I need to return a result set like :
select firstname,salary from employee where empno='x' where 'x' is
the value returned by the
java program & caught by DB2 function/stored procedure
So, the logic:
for (i=1;i<x;i++)
{
select firstname,salary from employee where empno='x'
}
should be implemented in the function/stored procedure.
4. This result set should be displayed on the standard output
Please help me out, as this is very urgent for me.
Thanks in advance...........
satish