Showing posts with label Expression. Show all posts
Showing posts with label Expression. Show all posts

Tuesday, 5 November 2019

Java Code Examples for javax.script.ScriptEngineManager.getEngineFactories()

The following are Jave code examples for showing how to use getEngineFactories() of the javax.script.ScriptEngineManager class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.



private boolean isJavaScriptAvailable() {
    if(isJSAvailableChecked) {
        return isJSAvailable;
    }
    ScriptEngineManager mgr = new ScriptEngineManager();
    List<ScriptEngineFactory> factories = mgr.getEngineFactories();
    for (ScriptEngineFactory factory: factories) {
        List<String> engNames = factory.getNames();
        for(String name: engNames) {
            if(name.equalsIgnoreCase("js") || name.equalsIgnoreCase("javascript")) { //NOI18N
                isJSAvailableChecked = true;
                isJSAvailable = true;
                return isJSAvailable;
            }
        }
    }
    isJSAvailableChecked = true;
    isJSAvailable = false;
    return isJSAvailable;
}



OAF:
Example
try { ScriptEngineManager mgr = new ScriptEngineManager(); ScriptEngineFactory[] factories = (ScriptEngineFactory[]) mgr.getEngineFactories(); for (ScriptEngineFactory factory: factories) { String[] engNames = factory.getNames(); for(String name: engNames) { System.out.println(name); } } } catch (Exception e) { }





Friday, 1 November 2019

System Variables In Oracle Forms list

List Of System Varible That are use iN oracle Forms

System variable
SYSTEM.BLOCK_STATUS
SYSTEM.COORDINATION_OPERATION
SYSTEM.CURRENT_BLOCK
SYSTEM.CURRENT_DATETIME
SYSTEM.CURRENT_FORM
SYSTEM.CURRENT_ITEM
SYSTEM.CURRENT_VALUE
SYSTEM.CURSOR_BLOCK
SYSTEM.CURSOR_ITEM
SYSTEM.CURSOR_RECORD
SYSTEM.CURSOR_VALUE
SYSTEM.DATE_THRESHOLD*
SYSTEM.EFFECTIVE_DATE*
SYSTEM.EVENT_WINDOW
SYSTEM.FORM_STATUS
SYSTEM.LAST_FORM
SYSTEM.LAST_QUERY
SYSTEM.LAST_RECORD
SYSTEM.MASTER_BLOCK
SYSTEM.MESSAGE_LEVEL*
SYSTEM.MODE
SYSTEM.MOUSE_BUTTON_PRESSED
SYSTEM.MOUSE_BUTTON_SHIFT_STATE
SYSTEM.MOUSE_ITEM
SYSTEM.MOUSE_CANVAS
SYSTEM.MOUSE_X_POS
SYSTEM.MOUSE_Y_POS
SYSTEM.MOUSE_RECORD
SYSTEM.MOUSE_RECORD_OFFSET
SYSTEM.RECORD_STATUS
SYSTEM.RIGHT_MOUSE_TRIGGER_NODE
SYSTEM.SUPPRESS_WORKING*
SYSTEM.TAB_NEW_PAGE
SYSTEM.TAB_PREVIOUS_PAGE
SYSTEM.TRIGGER_BLOCK
SYSTEM.TRIGGER_ITEM
SYSTEM.TRIGGER_MENUOPTION
SYSTEM.TRIGGER_NODE
SYSTEM.TRIGGER_NODE_SELECTED
SYSTEM.TRIGGER_RECORD

Decode Function

DECODE
Syntax
Purpose

DECODE compares expr to each search value one by one.

If expr is equal to a search,
Then Oracle Database returns the corresponding result.

If no match is found, then
Oracle returns default. If default is omitted, then Oracle returns null.

The arguments can be any of the numeric types (NUMBER, BINARY_FLOAT, or BINARY_
DOUBLE) or character types.

The maximum number of components in the DECODE function, including expr,
Searchesresults, and default, is 255.

DECODE ( expr , search , result
,
, default
)


Test Case
Create table plch_employees (
   Id    integer primary key
, name varchar2 (40)
, gender char (1)       
)
/
Insert into plch_employees values (100, 'Mr. John Doe','M')
/
Insert into plch_employees values (200, 'Mrs. Jane Doe','F')
/
Insert into plch_employees values (300, 'Ms. Julie Doe','F')
/
Insert into plch_employees values (400, 'Mr. Jack Doe','M')
/
Insert into plch_employees values (500, 'Dr. James Doe','M')
/
Insert into plch_employees values (600, 'Jonathan Doe','M')
/
Insert into plch_employees values (700, 'Jeff Jr. Doe','M')
/
Commit
/


select idnamedecode(gender, 'M''MALE''F''FEMALE', gender)
  from plch_employees;

Test Case:
/*
User have requirement ( if parameter value is 100 then query only show the result of those employee who have id no 100
Else query will show all employees
Expect 100 no ID)
*/
---we can handle it from our decode function 
Select idnameand decode (gender, ‘M’, MALE, ‘F’, ‘FEMALE’, gender)
  From plch_employees
  Where decode (id, 100,'Y','F') =decode (:v_id, 100,'Y','F');

Monday, 7 October 2019

Storing Expression Value in PLSQL and Java

Every Expression return True or False.
So we can easily store their value in Boolean expression

Using this Method we can easily check conditions instead of testing these scenarios in IF-ELSE condition .

---Example of Storing Expression Value in PLSQL

---Example of Storing Expression Value in PLSQL
--By mFaisal
declare
lExpressionValue boolean;
begin
  --- Expression Value
  lExpressionValue:=1=2 or 2=2;
 
  -- Is True Then
  ---1
  ---else
  --2
 
if  lExpressionValue Then
    --1
  DBMS_OUTPUT.put_line('Expression is  True..');
  else
    --- 2
  DBMS_OUTPUT.put_line('Expression is not True..');
  end if;


end;



Example of JAVA Code


public class Server {
   


    public static void main(String[] args) {
        Server.isTrue((1==2));
//isTrue((1=1)));
    }

   
    public static void isTrue(boolean expression) {
    if (expression) {
       System.out.println("Expression is true.");
    }
    else
    {
        System.out.println("Expression is not true.");
    }
    }
   

   
}



OADBTransactionImpl in Oracle Application Framework (OAF)

OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications...