Skip to Main Content

Java User Groups

Announcement

Testing banner

Java Condition Error after doing "String To Number Conversion In OAF - OA Framework

User_BUUZ8Jul 28 2020 — edited Sep 17 2020

import oracle.jbo.domain.Number;

      String slevel1 = pageContext.getParameter("ATTRIBUTE10");  // This is Page Parameter value

      String slevel2 = pageContext.getParameter("BILL_AMOUNT"); // This is Page Parameter value

     

       //  Try to convert string to Number 

      try

      {

         oracle.jbo.domain.Number nlevel1 = new oracle.jbo.domain.Number (slevel1);

         oracle.jbo.domain.Number nlevel2 = new oracle.jbo.domain.Number (slevel2); 

      

       // Number nlevel1 = new Number (slevel1);

       //Number nlevel2 = new Number (slevel2);      

      }

     

      catch (Exception e)

      {

          e.printStackTrace();    

      }    

        if((null!=slevel1)&&(null!=slevel2))

           {         

            if(nlevel1.intValue() > nlevel2.intValue())  // When I use the condition than Raise Error. If I don't use the condition than ERROR not show //

            {

            throw new OAException("level2 is greater than level1",OAException.ERROR);

            }

            }

----------- Show below Error -----------------------

Error(116,16): identifier nlevel1 not found

Error(116,38): identifier nlevel2 not found

Comments
Post Details
Added on Jul 28 2020
1 comment
389 views