1 Reply Latest reply on May 7, 2012 5:40 PM by 452071

    How to set the NLS in ADF for a session?


      Is there a built-in way to set the NLS parameters (Oracle-specific Date Format, Language..etc..) for the current DB session in ADF?

        • 1. Re: How to set the NLS in ADF for a session?
          Hi there,

          From your ViewController properties under Run you can add the following java option -Duser.timezone=CET. If you want to do it at the application level then you need to do the following:
          - In your AM override the prepareSession(Session session) method with custom code to set up your NLS
          - Create a class that implements the PagePhaseListener
          - Override beforePhase(PagePhaseEvent pagePhaseEvent) method to set the locale

          public void beforePhase(PagePhaseEvent pagePhaseEvent) {
          Integer phase = pagePhaseEvent.getPhaseId();
          if (phase.equals(ADFLifecycle.PREPARE_MODEL_ID)) {
          FacesContext facescontext = FacesContext.getCurrentInstance();
          String language =
          FODApplicationModuleImpl.preferredLanguage = language;
          FODApplicationModuleImpl.isWebUser = true;

          Hope this helps.

          Juaan C.
          1 person found this helpful