Tuesday, October 23, 2012

Apply ViewCriteria Programatically in AM

                CountryNameROVOImpl countryVO = this.getCountryNameROVO();
                CountryNameROVORowImpl countryRow = null;
       
               countryVO.applyViewCriteria(null);
               countryVO.setApplyViewCriteriaName("CountryNameROVOCriteria");
               countryVO.setBindCountryId(ccDTO.getCountry_code());
               countryVO.executeQuery();
              while(countryVO.hasNext()){
               CountryCodeResponseDTO countryDTO=new CountryCodeResponseDTO();
               countryRow=(CountryNameROVORowImpl) countryVO.next();
               countryDTO.setCountry_name(countryRow.getCountryName());
               nameResponse.add(countryDTO);
                                                           }

Friday, October 19, 2012

Get VO from JSF page to Backing Bean


        DCBindingContainer bindings =
            (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
     
        DCIteratorBinding iter =
            bindings.findIteratorBinding("CountryTRVOIterator");
     
        CountryTRVORowImpl countryRow= (CountryTRVORowImpl) iter.getCurrentRow();
     
       System.out.println(countryRow.getCountryId());

Wednesday, October 17, 2012

Logic to convert jbo date to util date

        //logic to convert jbo date to util date

        oracle.jbo.domain.Date oracleDate = empRow.getHireDate();
        java.sql.Date javaSqlDate = oracleDate.dateValue();
        long javaMilliSeconds = javaSqlDate.getTime();
        java.util.Date javaUtilDate = new java.util.Date(javaMilliSeconds);

        empDTO.setHire_date(javaUtilDate);

Tuesday, October 16, 2012

Call AM Method from WebService Or Java Project

import com.model.common.AppModule;
import oracle.jbo.ApplicationModule;
import oracle.jbo.client.Configuration;

  AppModule am =(AppModule) Configuration.createRootApplicationModule("com.model.AppModule","AppModuleLocal");

 am.callGreetingFunction();

//We use this if AM is not a part of existing project(Remember to Include in Dependency Properties)

Friday, October 12, 2012

Calling AM method from backing bean


import oracle.binding.BindingContainer;
import oracle.adf.model.BindingContext;
import oracle.binding.OperationBinding;  

 public String onCommitButtonClick() {
        // Add event code here...
        BindingContainer binding = (BindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();  
        OperationBinding  operationBinding=binding.getOperationBinding("onCommit");
        Object result=operationBinding.execute();
        if(!operationBinding.getErrors().isEmpty()){
            return null;
        }
        return null;
    }

RowSetIterator don't miss the first column ADF

  
Here is a sample..

 public void onCommit(){
        ContactVOImpl contactVO=(ContactVOImpl)this.getContactVO();
        RowSetIterator rowSet = contactVO.createRowSetIterator(null);
      
      
        while(row.hasNext()){
            ContactVORowImpl row1=(ContactVORowImpl) rowSet .next();
            System.out.println("ContactId " +row1.getContactid());
            System.out.println("CustomerId "+row1.getCustomerid());
        }
        rowSet.closeRowSetIterator(); //close the Iterator
        getDBTransaction().commit();
    }


where as the below code...starts printing from 2nd column..

    public void onCommit(){
        ContactVOImpl contactVO=(ContactVOImpl)this.getContactVO();
           
        while(contactVO.hasNext()){
            ContactVORowImpl row1=(ContactVORowImpl) contactVO.next();
            System.out.println("ContactId " +row1.getContactid());
            System.out.println("CustomerId "+row1.getCustomerid());
        }

        getDBTransaction().commit();
    }

Tuesday, October 9, 2012

How to expose services from the windows virtual machine in cloud?

  • Create a Windows VM instance on cloud.
  • Install all the software required for the service.
  • Start any server Weblogic or Apache tomcat server on which you are deploying.
  • In the Admin console(webpage) settings of VM i,e in the browser of your Personal System... Configure the end points (tcp:Port numbers for eg 7001 for weblogic,80 for public and 8080 for private networks) to expose them to public
  • Finally you have to disable firewall settings in the VM..

Now you can use a service deployed on the web-server from a remote system through internet using public ip address given by the service provider

http://www.windowsazure.com/en-us/develop/java/tutorials/tomcat-on-a-virtual-machine/
http://www.youtube.com/watch?v=IX8xb-suzVg

Hope this helps you  



Thursday, October 4, 2012


TO_DATE in SQL

Alternatively, you may use TO_DATE explicitly:
insert into x
values(99, to_date('1998/05/31:12:00:00AM', 'yyyy/mm/dd:hh:mi:ssam'));
The general usage of TO_DATE is:
TO_DATE(, '')