Thursday, March 01, 2018

ADF - Sample Java Code To Iterate VO Data



Following is the code snippet to extract the data from VO.

Below code is very similar to the logic which we write in OAF (Oracle Application Framework)

public class AppModuleAMTest {
   
     public static void main(String args[])
     {
       //bc4jclient --press enter 
         String amDef = "oracle.fod.storefront.model.module.AppModuleAM";
        String config = "AppModuleAMLocal";
        ApplicationModule am =
            Configuration.createRootApplicationModule(amDef, config);
        ViewObject vo = am.findViewObject("Employees1");
        vo.executeQuery();
        while(vo.hasNext())
        { 
             Row empRow = vo.next();
             System.out.println("Employee ID -->"+ empRow.getAttribute(1));
           
            }
        // Work with your appmodule and view object here
        Configuration.releaseRootApplicationModule(am, true);
         }
}

No comments: