How to call a Java method, pl/SQL from within ApEx

I want to call a Java method, which I intend to use to add members to a collection at the ApEx of another source of data.



How does one call a Java from ApEx method?



Thank you

Gregory


Hello

Curious, the link works fine for me.

Anyway, here is another, a thread on AskTom site that addresses the basic concepts you need-

http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:952229840241

Hope this helps,

John.
--------------------------------------------
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
AWARDS: Don't forget to mark correct or useful posts on the forum, not only for my answers, but for everyone!

Tags: Database

Similar Questions

  • How to call a Java method n map the output of this method to a table in ODI

    Hello

    I am new to ODI. I wrote an interface that links the two tables (source) to a file (in the target). Now, I must apply a method (java call) on each element in a column in the target. Now my questions are:

    1. all I know is to use the procedure using BeanShell Java or Jython. Can you give some examples of commands to achieve such a feature?

    2. where should I actually apply this procedure? Is it possible to apply this procedure within the Interface during the mapping (so that I can map directly the result in the output file)?

    Thanks in advance :)

    Not sure why you want to call a java method for each column.
    But as others have mentioned, an ODI procedure won't help you do.

    However, there are other options you can exercise:
    (1.) assuming that you are using Oracle, you can compile the Java class and wrap it as a PL/SQL function and then call this function from pl/sql to the ODI interface. This procedure will be called like any other function oracle for example. Upper (col1).

    (2.) as I understand, it's that you want to apply the Java method for all columns.
    Assuming that you have knowledge with Jython and the code inside the KMs, you can customize the KM to include the Java method around the columns. But this approach is complex if you are a beginner.

    Hope that helps

  • Call the java method lunch application

    Hello

    I use JDev 12.1.3 with MAF, I want to call the java method of the project ViewController lunch application, how can I do this?

    Thank you

    Hello

    Can you explain usecase? What features do you need perform the start-up of the application?

    You can run java code in an application LifeCycleListener - https://docs.oracle.com/middleware/maf210/mobile/develop-maf/maf-apps-register-listeners.htm#ADFMF25120

  • Calling a Java method in a page JSFF fragment.

    Can someone tell me how I can call a Java method in a page JSFF fragment?

    Here's an excerpt from my jsff (My.jsff):

    < af:column sortProperty = "CrtdByUserid" sortable = "false".
    headerText = "#{customstoregroupviewcontrollerBundle.USER_LABEL} '"
    ID = "user" align = "center" >
    < af:outputText value = "#{rank." CrtdByUserid}"id ="ot5"/ >
    < / af:column >

    Here is the method of my Java (MyBacking.java)

    public String resolveUserName (String pUserId) {}
    try {}
    JCCRoleHelper jccrh = new JCCRoleHelper();
    Return jccrh.getUserName (pUserId);
    } catch (Exception e) {}
    return pUserId;
    }
    }

    I would replace "#{rank." CrtdByUserid}"in My.jsff with a call to the java method"resolveUserName (String pUserId)"of My.java by passing the value of" #{rank. " CrtdByUserid}"to return the string to fill the 'af:outputText = value'.

    Any help would be greatly appreciated.

    Hello

    create and save a bean inside taskflow, for example, name it userResolverBean.

    The bean code

    import java.util.HashMap;
    
    public class UserResolverBean {
    
        private HashMap _user;
    
        public UserResolverBean() {
            _user = new HashMap() {
                    @Override
                    public Object get(Object key) {
                        if(key == null)
                            return null;
                        return resolveUserName(key.toString());
                    }
                };
        }
    
        public String resolveUserName(String pUserId) {
            try {
                JCCRoleHelper jccrh = new JCCRoleHelper();
                return jccrh.getUserName(pUserId);
                } catch (Exception e) {
                return pUserId;
            }
    
        }
    
        public HashMap getUser() {
            return _user;
        }
    }
    

    and use it like this

    
    
    
    

    Cheers!

    Kind regards

    Published by: Santosh Vaza on August 8, 2012 11:48

  • How to call the java function with javascript setting in mobile adf?

    How to call the java function with javascript setting in mobile adf?

    The ADF Mobile utility container API can be used from JavaScript or Java.

    Application container API - 11 g Release 2 (11.1.2.4.0)

  • What is the best way to call the Java method in JSP in weblogic 10.3

    Hello

    What is the best way to call the Java method in JSP in weblogic 10.3?

    Thank you for your help in advance.

    Thank you
    Manu

    Hello Manu,

    If I understand your question, all you need to do is import the Java class you want to create / obtain an instance of it (if you're not calling a static method), then call the method, the entire interior of the JSP. It works the same way in Weblogic that it works in any JSP.

    Kevin

  • How can I change my method of payment from Paypal to debit card?

    How can I change my method of payment from Paypal to debit card? When I go on manage payment options that I only gave Paypal as payment without possibility of change.

    Yes, you will be able to use paypal, and if you get your subscription canceled, you will suffer no loss of data.

  • How can I change my method of payment from PayPal on a credit card...?

    How can I change my method of payment from PayPal on a credit card?

    Hi Stacy,

    Please visit the following link: https://helpx.adobe.com/creative-cloud/help/manage-cc-individual-membership.html

    Let me know if you face any problem.

    Kind regards

    Rahul

  • Connector WFD SDK - how to call the server method?

    I use the FMS connector C++ to perform editing work. And I am obliged to call a method side server.

    I tried to use the INetConnection::call () method, but it seems to be successful.


    The specification of the server FMS told me to do,

    1. call the server method,

    NC. Call (streamname, null, "FCPublish");


    2. implement a callback function onFCPublsih

    nc.onFCPublish = function (info) {...}

    How can I implement the latter with FMS Connector C++?

    The FMS connector document include a subject too little on the method call server-side.

    WFD SDK connector, the netconnection call prototype looks like this.

    virtual bool call (const char * funcName, const unsigned char * arguments, unsigned size, OnResultHandler * result) = 0;

    Thus, you will have to serialize the arguments and then pass it to call the function.

    Check

    bool FMSCTester::testCall (const char * cmd, const char * arg)

    method in FMSCTester sample application that comes with the software development kit how to serialize and call the function.

    For Server callbacks, you have to implement a netconnection sink with the onCommand method is called when the server calls a method on the client.

    The onCommand prototype looks like this,

    onCommand Sub (const char * cmd, const unsigned char * arguments, unsigned bufLen, IRetValue * retVal)

    again, you can check the MyNCSink class in the FMSCTester sample project for an implementation of onCommand.

  • How to call a Java object / Servlet of a trigger

    Could Hi someone please help me on this issue.

    We use the Oracle 10 g in our database.

    It is possible to write a trigger so that, whenever there is a change in the database (insert/update), we need to call a Servlet / or any Java program

    Any link will be a great help.

    Thanks in advance.

    Yes, you could use a trigger to call a java program stored in the database, or call a remote URL using UTL_HTTP.

    You must be more specific about what it does, where the program is and how to call it. It is in the database? On the operating system? On a remote Web server?

    A quick search with google would have answered this question for you and found you examples.

  • How to call a taskflow based on results from the drop-down list. ?

    Hello

    I want to call a taskflow based on the results of the drop-down list, I have a drop down list with LOV, if I choose a value insofar as it must call the taskflow are entrusted to him. How to do this. ?. How to assign a taskflow for all values and how to call it. Someone please help...

    Page:

    http://Java.Sun.com/JSP/page"version ="2.1 ".

    xmlns:af ="http://xmlns.oracle.com/adf/faces/rich" >. "

    valuePassThru = 'true '.

    valueChangeListener = "#{SelectBean.onSelection}" > "

    Main.XML (TaskFlow);

    http://xmlns.Oracle.com/ADF/controller"version ="1.2">

    Choose

    Choose.JSFF

    /Web-INF/FirstTF.XML

    FirstTF

    /Web-INF/SecondTaskFlow.XML

    SecondTaskFlow

    Choose

    First

    FirstTF

    Second

    SecondTaskFlow

    Code VlaueChange Listner already told you.

    First and second pages only contain output text component in my example. I think that is not necessary

    Concerning

    Vincent

  • How to call support bean method when the user moves out of field of af: inputListOfValues

    Hello

    I use jdev 11.1.2.4.

    I want to call a method of bean of support depending on the value selected in the af:inputListOfValues field.

    The requirement is similar as Frank Nimphius-Oracle has shown here https://blogs.oracle.com/jdevotnharvest/entry/how_to_notify_the_server but with component input list of values.

    The areas I want to call the method is

    <af:inputListOfValues id="appealNameId"
                          popupTitle="Search and Select: #{bindings.AppealName.hints.label}"
                          value="#{bindings.AppealName.inputValue}"
                          label="#{bindings.AppealName.hints.label}"
                          model="#{bindings.AppealName.listOfValuesModel}"
                          required="#{bindings.AppealName.hints.mandatory}"
                          columns="#{bindings.AppealName.hints.displayWidth}"
                          shortDesc="#{bindings.AppealName.hints.tooltip}"
                          binding="#{backingBeanScope.backing_Donation.appealNameId}"
                          autoSubmit="true" clientComponent="false">
                          <f:validator binding="#{bindings.AppealName.validator}"/>
                          <af:autoSuggestBehavior suggestedItems="#{backingBeanScope.backing_Donation.onSuggestAppeal}"/>
                          <af:clientListener method="onBlurTxtField" type="blur"/>
    </af:inputListOfValues>
    <af:serverListener type="onBlurNotifyServer"
                       method="#{backingBeanScope.backing_Donation.onBlurNotify}"/>
                          
    

    as you can see, af:serverListener is outside the af: inputListOfValues which is probably the reason why this isn't executing this method?

    public void onBlurNotify(ClientEvent clientEvent) {
       // get a hold of the input text component
       RichSelectOneChoice inputTxt =  (RichSelectOneChoice) clientEvent.getComponent(); 
       //do some work on it here (e.g. manipulating its readOnly state)
       //…
       //Get access to the payload
        
       Map  parameters = clientEvent.getParameters();
       System.out.println("SubmittedValue = "+parameters.get("submittedValue"));
       System.out.println("LocalValue =  "+parameters.get("localValue"));
       }
    

    I tried to put the serverListener tag inside the < af:inputListOfValues > but get error below

    "Listener server is not a valid child of list of values of the entry.


    any ideas please?

    Thank you

    As first, make sure you use a correct type for af:serverListener (Traore we are you queue in the javaScript onBlurTxtField function)

    If still not working, go directly to the source code page, and put af:serverListener 'manually', as a child for af:inputListOfValues.

    Because it is possible that these messages are false alarms...

  • How to call a session variable in sql?

    for example, I have a coldfusion session variable - session.testvar

    I am writing a stored procedure in sql server 2000. The query within my stored procedure must insert a value into a table. The value must be my session variable CF. I don't know how it's done, someone else has a hunch?

    I use coldfusion 8 and sql server 2000.

    Pass it to the SP as a variable

    -There are examples in the docs of CF

  • How to call the AM method that accepts the parameter other than a string

    Hello

    I need to pass 2 parameters from the date of my method of AM.
    I checked the jdev doc and found the method which can be used for anything other than a string below parameter

    public Serializable invokeMethod (String methodName,
    [Serializable] methodParams,.
    Class [] methodParamTypes)

    one thing that I am not able to understand how to pass multiple dates in a single parameter of the class.
    can anyone tell me the syntax to invoke method for the passage of 2 dates.

    Hello

    Suppose you have a string and two date parameters

    Test of the chain;
    Date date1;
    Date2 date;

    Then move it like this

    OAApplicationModule am = pageContext.getApplicationModule (webBean);

    Serializable [] parameters is {test, date1, date2};.
    Class [] paramTypes = {String.class, Date.class, Date.class};
    am.invokeMethod ("initSummary", parameters, paramTypes);

    Thank you
    Gerard

  • How to call a variable in a SQL block?

    Hello everyone.

    I'm relatively new to the black magic of PL/SQL... I'm struggling with something that I think should be relatively easy. I hope someone can direct me as to where I'm wrong?

    I have a SQL query that is basically divided into 5 different sections - all the union'ed. Each Union has a date condition in the FROM clause that requires a sub query. The sub itself query takes a long time to run, so rather than including 5 times in my code block - I think its probably much more effective to declare the output of the query to sub as a variable at the beginning of my script.

    I managed to do it. What I am struggling with actually called the variable in my script SQL... Sort - the following code:

    < code >
    DECLARE
    v_last_batch_date varchar (8);
    BEGIN
    SELECT MAX (C.FDP_DATA_DATE)
    IN v_last_batch_date
    OF TBL_DAILY_BALANCE C
    WHERE C.FDP_DATA_DATE BETWEEN TO_CHAR (ADD_MONTHS (TRUNC (SYSDATE),-1), 'YYYYMM') | (' 25' AND TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE),-1)), 'YYYYMMDD'));
    IMMEDIATE EXECUTION
    '-UNION 1
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO > = 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES 0 OTHERWISE END) AS PROMO_CYCLES
    Of
    TBL_DIM_SECURITY, A.
    E TBL_DIM_PRODUCT
    WHERE
    A.DSE_DATA_DATE = v_last_batch_date
    AND A.DSE_X = E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = 'PURE '.
    UNION ALL
    -UNION 2
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO > = 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES 0 OTHERWISE END) AS PROMO_CYCLES,
    Of
    TBL_DIM_SECURITY HAS
    E TBL_DIM_PRODUCT
    WHERE
    A.DSE_DATA_DATE = (SELECT MAX (C.FDP_DATA_DATE) OF BUSINT_OWNER. C TBL_FACT_DAILY_PLAN_BALANCE WHERE C.FDP_DATA_DATE BETWEEN TO_CHAR (ADD_MONTHS (TRUNC (SYSDATE),-1), 'YYYYMM') | (' 25' AND TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE),-1)), 'YYYYMMDD'))
    AND A.DSE_X = E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = 'CC '.
    UNION ALL
    -UNION 3
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO > = 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES 0 OTHERWISE END) AS PROMO_CYCLES,
    Of
    TBL_DIM_SECURITY HAS
    E TBL_DIM_PRODUCT
    WHERE
    A.DSE_DATA_DATE = v_last_batch_date
    AND A.DSE_X = E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = 'BT '.
    UNION ALL
    -UNION 4
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO > = 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES 0 OTHERWISE END) AS PROMO_CYCLES,
    Of
    TBL_DIM_SECURITY HAS
    E TBL_DIM_PRODUCT
    WHERE
    A.DSE_DATA_DATE = v_last_batch_date
    AND A.DSE_X = E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = 'CA '.
    UNION ALL
    -UNION 5
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO > = 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES 0 OTHERWISE END) AS PROMO_CYCLES,
    Of
    TBL_DIM_SECURITY, A.
    E TBL_DIM_PRODUCT
    WHERE
    A.DSE_DATA_DATE = v_last_batch_date
    AND A.DSE_X = E.DPT_Z
    AND A.DSE_PLAN_CATEGORY NOT IN ('PURE', 'CA', 'BT', 'CC')';
    END;
    < code >

    I simplified the code SQL a bit just... someone can point me in the right direction, please?

    Very much appreciated - and Merry Christmas!
    Try running with
    
    DECLARE
    v_last_batch_date VARCHAR(8);
    BEGIN
    SELECT MAX(C.FDP_DATA_DATE)
    INTO v_last_batch_date
    FROM TBL_DAILY_BALANCE C
    WHERE C.FDP_DATA_DATE BETWEEN TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE),-1),'YYYYMM')||'25' AND TO_CHAR(LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE),-1)),'YYYYMMDD'));
    EXECUTE IMMEDIATE'--- UNION 1
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO >= 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES ELSE 0 END) AS PROMO_CYCLES
    FROM
    TBL_DIM_SECURITY A,
    TBL_DIM_PRODUCT E
    WHERE
    A.DSE_DATA_DATE =' || v_last_batch_date || '
    AND A.DSE_X=E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = ''PUR''
    UNION ALL
    --- UNION 2
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO >= 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES ELSE 0 END) AS PROMO_CYCLES,
    FROM
    TBL_DIM_SECURITY A
    TBL_DIM_PRODUCT E
    WHERE
    A.DSE_DATA_DATE = (SELECT MAX(C.FDP_DATA_DATE) FROM BUSINT_OWNER.TBL_FACT_DAILY_PLAN_BALANCE C WHERE C.FDP_DATA_DATE BETWEEN TO_CHAR(ADD_MONTHS(TRUNC(SYSDATE),-1),''YYYYMM'')||''25'' AND TO_CHAR(LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE),-1)),''YYYYMMDD''))
    AND A.DSE_X=E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = ''CC''
    UNION ALL
    --- UNION 3
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO >= 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES ELSE 0 END) AS PROMO_CYCLES,
    FROM
    TBL_DIM_SECURITY A
    TBL_DIM_PRODUCT E
    WHERE
    A.DSE_DATA_DATE = v_last_batch_date
    AND A.DSE_X=E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = ''BT''
    UNION ALL
    --- UNION 4
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO >= 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES ELSE 0 END) AS PROMO_CYCLES,
    FROM
    TBL_DIM_SECURITY A
    TBL_DIM_PRODUCT E
    WHERE
    A.DSE_DATA_DATE = ' || v_last_batch_date ||'
    AND A.DSE_X=E.DPT_Z
    AND A.DSE_PLAN_CATEGORY = ''CA''
    UNION ALL
    --- UNION 5
    SELECT
    (CASE WHEN A.MTHS_LFT_PUR_PROMO >= 0 THEN A.DTC_PKEY_PUR_PROMO_CYCLES ELSE 0 END) AS PROMO_CYCLES,
    FROM
    TBL_DIM_SECURITY A,
    TBL_DIM_PRODUCT E
    WHERE
    A.DSE_DATA_DATE =' || v_last_batch_date || '
    AND A.DSE_X=E.DPT_Z
    AND A.DSE_PLAN_CATEGORY NOT IN ( ''PUR'',''CA'',''BT'',''CC'')';
    END;
    

Maybe you are looking for