How to call java function with parameter from javascript in adf mobile?

how to call java function with parameter from javascript in adf mobile?

The ADF Mobile Container Utilities API may be used from JavaScript or Java.
Application Container APIs - 11g Release 2 (11.1.2.4.0)

Similar Messages

  • How to call sql procedure with parameter from java

    Hello,
    i am trying to call one sql procedure with two parameters from java.
    the first parameter is In parameter, the second is OUT.
    the return value of this java method should be this second parameter value.
    the following is my java code:
    protected String getNextRunNumber() {
         String runnumber=null;
         String sql = "{call APIX.FNC_SST_EXPORT.GET_NEXT_RUNNUMBER (?,?)}";
    CallableStatement state = null;
    try{
         Connection con= getDatabaseConnection();
         state = con.prepareCall(sql);
         state.setString(1, m_appKeyExport);
         state.registerOutParameter(2,Types.NUMERIC,0);
         state.execute();
    ResultSet resultR = (ResultSet)state.getObject(2);
         while (resultR.next()) {
              runnumber=resultR.getBigDecimal(1).toString();
    catch (SQLException e){System.out.println("You can not get the export next run number properly");}
    return runnumber;
    i got error message like:
    java.lang.ClassCastException: java.math.BigDecimal
    As far as i knew, if the parameter is number or decimal, we should give also the paramer scale to the method: state.registerOutParameter(), but i still get this error message.
    Please help me to solve this problem.
    Thanks a lot.

    state.execute();
    i try to use debug to find the problem, in this line, i saw
    OracleCallableStatement(OraclePreparedStatement).execute() line: 642 [local variables unavailable]
    is this the problem?

  • How to call java function from PL/sql in oracle applications

    I am trying to call a java function from plsql procedure. Can any one explain how to call java function, and in which directory I have to store my java function in oracle applications. Do I need to register that java function from Application developer.
    Thanks
    Kranthi

    http://www.oracle.com/technology/tech/java/jsp/index.html
    Good Luck,
    Avi.

  • How to call java function in javascript

    Hello Everyone,
    Can anyone tell me solution that:
    How to call java function in javascript?
    Thanks,
    VIDs

    You can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
    But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want.

  • How to call a function with pl/sql

    How does one call a function with pl/sql that uses a function?

    Hi,
    How does one call a function with pl/sql that uses a
    function?I'm not sure what you mean.
    In PL/SQL function can be used just about anywhere where an expression (with the same data type that the function returns). Arpit gave a very common example.
    Here's another example, where all the functions take a single NUMBER argument and return a NUMBER, so they can all be used in places where NUMBERs are used:
    IF  fun_a (fun_b (0)) < fun_c (1)
    THEN
        UPDATE  table_x
        SET     column_y = fun_d (2)
        WHERE   column_z = fun_e (ROUND ((fun_f (3), fun_g (4)));You call a function simply by using its name, followed by its argument list, if any.
    If the function is in a package, you must call it with the package name, like "pk_foo.bar (1, 2, 3)", unless the call comes from within the same package.
    If the function is owned by someone else, you must give the owner name, like "scott.bar (SYSDATE)" or "scott.pk_foo.bar (1, 2, 3)". You can create synonyms to avoid having to name the owner.

  • How to call a function with event

    How do I call a function with a event inside it?
    function showTopTen(e:Event):void
        highscoreData = new XML(e.target.data);
        trace("Hiscores: " + highscoreData.item[0].name.text() + " - " + highscoreData.item[0].score.text())
    //showTopTen();  ..??

    Could you indicate why you would want to?
    The eventhandler you show here uses the properties of the event object passed as an argument.
    The way I read it it is data retrieved from a server so your app won't know anything about is untill it is loaded from the server which should be done with an URLLoader object which in it's turn calls your eventHandler when the Event.COMPLETE is triggered.
    something like:
    var urlLoader = new URLLoader();
    urlLoader.addEventListener( Event.COMPLETE, showTopTen )
    urlLoader.load( new URLRequest( "http:// etc." ) );
    to me would seem the proper method to have the function execute.

  • How to call report rdf with parameter passing..

    Hai
    I am using 10g developer suite and 10 g report. I want to call some report in the when_button_pressed trigger. like c:\ report\ test.rdf file. we don't have separate application server.more than 10 users using forms and report. Without application server (dedicated application server ) we are using oracle.
    How to call the report rdf file from form ? how to pass the parameters ? how to start the report server ? I tried many answers I am not getting correct coding plese help me to find out correct code .. run the report perfectly... from form.
    digging here not get correct coding... please help me.. urgent
    vasanth.

    Hai,
    It seems same 6i reports coding, I am not aware of that.. Soon I will tell you..
    Thanks a lot.
    regards
    vasanth

  • How to call a function with generic table parameter

    Hi everybody
    I need to call function module RSAR_ODS_API_GET (from BW). It recive an internal table with request ids and should return in E_T_DATA "unstructured" data from the psa and in E_T_RSFIELDTXT the description of the data structure, I guess
    from sap help only thing I have reggarding how to use the function module is :
    "You can call up the function module RSAR_ODS_API_GET with the list of request IDs given by the function module RSSM_API_REQUEST_GET. The function module RSAR_ODS_API_GET no longer recognizes InfoSources on the interface, rather it recognizes the request IDs instead. With the parameter I_T_SELECTIONS, you can restrict reading data records in the PSA table with reference to the fields of the transfer structure. In your program, the selections are filled and transferred to the parameter I_T_SELECTIONS.
    The import parameter causes the function module to output the data records in the parameter E_T_DATA. Data output is unstructured, since the function module RSAR_ODS_API_GET works generically, and therefore does not recognize the specific structure of the PSA. You can find information on the field in the PSA table using the parameter E_T_RSFIELDTXT."
    unfortunately I when running de report bellow, I get a dump which says:
    Function parameter "E_DATA" is unknown
    in the definition of the interface E_DATA has no type, which  means it can recive any table type, right?
    So I have two questions?
    1) How to get the code working
    2) How do I use the parameter E_T_RSFIELDTXT to parse the data returned in E_DATA
    by debuging RSSM_API_REQUEST_GET for this code I found it try to put an internal table with the struct of the database table /BIC/B0000151000 in E_DATA
    Thanks a lot for any help
    rgds
    my test report is:
    REPORT  ZTEST_PSA_API.
    TABLES: /BIC/B0000151000 .
    TYPE-POOLS: RSSM.
    TYPES: BEGIN OF STC_REQ_LINE,
      sign(1),
             option(2),
             low  TYPE rsa_request,
             high TYPE rsa_request,
             END OF STC_REQ_LINE,
      IT_REQUEST TYPE STC_REQ_LINE OCCURS 0.
    DATA: lit_request TYPE RSSM_T_API_REQUEST_GET WITH HEADER LINE,
          lc_system TYPE RSSM_T_API_LOGSYS,
          lit_request1 TYPE IT_REQUEST WITH HEADER LINE.
    DATA: lc_dtarget_name TYPE RSA_ODSNAME,
          lit_meta_data TYPE RSARC_T_RSFIELDTXT.
    DATA: lt_psa_data LIKE /BIC/B0000151000 OCCURS 0.
    CALL FUNCTION 'RSSM_API_REQUEST_GET'
      EXPORTING
        I_SOURCE    = '2LIS_13_VDITM'
        I_TYP       = 'D'
        I_DATEFROM  = '20060627'
      IMPORTING
        E_T_REQUEST = lit_request[]
        E_T_LOGSYS  = lc_system
        EXCEPTIONS  = 1.
    READ TABLE lit_request.
    lit_request1-sign = 'I'.
    lit_request1-option = 'EQ'.
    lit_request1-low = lit_request-request .
    APPEND lit_request1 .
    break-point .
    CALL FUNCTION 'RSAR_ODS_API_GET'
      EXPORTING
        I_T_REQUEST = lit_request1[]
      IMPORTING
        E_ODSNAME = lc_dtarget_name
        E_T_RSFIELDTXT = lit_meta_data
      TABLES
        E_DATA = lt_psa_data
      EXCEPTIONS
        NO_DATA_FOUND = 1
        PARAMETER_FAILURE = 2
        REQUEST_NOT_AVAILABLE = 3
        NO_REQUEST_FOUND = 4
        NO_FIELDS_TO_ODS = 5
        NO_ODS_FOUND = 6
        PACKAGE_LOCKED_BY_LOADING = 7 .

    Try to pass table parameter without "[]" :
    CALL FUNCTION 'RSAR_ODS_API_GET'
    EXPORTING
    I_T_REQUEST = lit_request1
    IMPORTING
    E_ODSNAME = lc_dtarget_name
    E_T_RSFIELDTXT = lit_meta_data
    TABLES
    E_DATA = lt_psa_data

  • Xdk: calling java function with a CharSequence parameter

    When using xdk version 10.1.0.2.0_production, you can not call a javamethod with a CharSequence parameter.
    Sun documentation:
    Interface CharSequence
    All Known Implementing Classes:
    CharBuffer, String, StringBuffer
    This prevents us from calling a method like
    java.util.regex.Pattern.matches(String, CharSequence)
    Converting the parameter to a normal string would solve the problem.
    Example to illustrate the issue:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes" xmlns:Pattern="http://www.oracle.com/XSL/Transform/java/java.util.regex.Pattern">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xsl:if test="Pattern:matches('...','123')">
    <xsl:text>MATCH</xsl:text>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    results in the following stacktrace:
    oracle.xml.parser.v2.XPathException: Extension function error: Error invoking 'matches':'java.lang.NullPointerException'
         at oracle.xml.parser.v2.XSLExtFunctions.callStaticMethod(XSLExtFunctions.java:113)
         at oracle.xml.parser.v2.XPathExtFunction.evaluateMethod(XPathExtFunction.java:296)
         at oracle.xml.parser.v2.XPathExtFunction.evaluate(XPathExtFunction.java:223)
         at oracle.xml.parser.v2.XSLCondition.testCondition(XSLCondition.java:185)
         at oracle.xml.parser.v2.XSLCondition.processAction(XSLCondition.java:165)
         at oracle.xml.parser.v2.XSLNode.processChildren(XSLNode.java:403)
         at oracle.xml.parser.v2.XSLTemplate.processAction(XSLTemplate.java:191)
         at oracle.xml.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:507)
         at oracle.xml.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:484)
         at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:256)
         at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:146)
         at oracle.xml.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:218)
         at XSLSample.main(XSLSample.java:75)
    Message was edited by:
    user449717

    Hi Grarup,
    I took a stab at getting this to run and compile and this is what I came up with.  Let me know if this helps at all.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ConsoleApplication1
    class Program
    static void Main(string[] args)
    Console.WriteLine("\"True\" or \"False\"?");
    bool boolVal = bool.Parse(Console.ReadLine());
    Functions f = new Functions();
    TestStruct t = new TestStruct() { Value = boolVal };
    f.Flip(ref t);
    Console.WriteLine(string.Format("Flipped value = {0}: ", t.Value));
    Console.ReadLine();
    public struct TestStruct
    public bool Value;
    public class Functions
    public void Flip(ref TestStruct testStruct)
    testStruct.Value = !testStruct.Value;
    Best of luck.

  • How to call LabView function with nested structs and arrays from C#

    Hi,
    I've got the following functions defined in a LabView-dll:
    uint32_t __stdcall VOSC04_General(uint32_t Command, TD18Hdl *Messages);
    uint32_t __stdcall CheckDiameter(uint32_t Command, TD6 *Parameter);
    typedef struct {
     double SP_Diameter;
     double SP_Tolerantie;
     double PV_Diameter;
     } TD6;
    typedef struct {
     int32_t dimSize;
     int32_t Numeric[1];
     } TD18;
    typedef TD18 **TD18Hdl;
    I've got some C#-code (generated by PInvoke-wizard) to call these functions:
    [DllImport("vosc04.dll")]
    public static extern uint32_t VOSC04_General (uint32_t Command, ref TD18Hdl Messages);
    [DllImport("vosc04.dll")]
    public static extern uint32_t CheckDiameter(uint32_t Command, ref TD6 Parameter);
    [StructLayout(LayoutKind.Sequential,Pack=4)]
    public struct TD18
       public int32_t dimSize;
       [ MarshalAs( UnmanagedType.ByValArray, SizeConst=1)]
       public int32_t [] Numeric;
    [StructLayout(LayoutKind.Sequential,Pack=4)]
    public struct TD6
       public Double SP_Diameter;
       public Double SP_Tolerantie;
       public Double PV_Diameter;
    The problem now is that when I try to read the Messages-output-parameter, I get wrong values (pointers?). I think that the problem lies in the fact that LabView generated a TD18 AND an TD18Hdl struct.
    How can I correct this problem?
    Can anyone give me some advise to correct this problem? I'm not an expert in C, only in C#.

    I think the problematic line is this:
    public struct TD18
       public int32_t dimSize;
       [ MarshalAs( UnmanagedType.ByValArray, SizeConst=1)]
       public int32_t [] Numeric;
    It looks like C# is forcing the array to be of size 1. The thing is, LabVIEW stores arrays as handles which are double pointers to a structure which contains a size element followed by the elements of the array. For your example, int32 arrays are stored in memory as:
    handle -> location -> |size|element 1|element 2| .... |element size-1|
    Because C does not do runtime array bounds checking, you can get away by declaring the structure as:
    typedef struct {
     int32_t dimSize;
     int32_t Numeric[1];
     } TD18;
    The correct declaration would've been:
    typedef struct {
     int32_t dimSize;
     int32_t Numeric[size];
     } TD18;
    But size is not a constant, so C/C++ won't let you do that. So, even though the array is declared to be of size 1, it can (and usually does) have more than 1 element. This does not cause a problem because LabVIEW allocates memory based on the actual size of the array.
    If I were you, I'd try to change the prototype of the LabVIEW DLL function to accept a pointer to array data, rather than an array handle, pre-allocate memory for the array in C# and pass a pointer to the allocated memory into LabVIEW so that LabVIEW can "fill it up".
    Let me know if you need more information.
    Pramod

  • How to call java function in Oracle forms?

    Hi I am having Oracle 9i with 10g Developer Suite.
    I am new to Oracle forms..
    I had one function in java getDatas()..
    How can I call this function in Oracle Forms..
    Pls help
    Thanks

    Thanks Francois,
    I want to display values from my java code in the Forms..
    For that purpose only i am installing 10g Developer Suite..
    The below is java code..
    public class DBTest {
              public static String callDB(int id,String name){
              String ss="Hai";
              Connection con=null;
              try{
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   con = DriverManager.getConnection("url","id","pwd");
                   Statement st=con.createStatement();
                   System.out.println("Connected...");
              int r=st.executeUpdate("Insert into FORM_TEST VALUES('"+id+"','"+name+"')");
                   if(r==1){
                        ss="Inserted Sucessfully";
                   else{
                        ss="Insertion Failed";
              }catch(final Exception e){
              System.out.println(e);
              return ss;
         public static void main(String[] args) {
              int empid=102;
              String empname="Gilbert";
              String resultStr=callDB(empid,empname);
              System.out.println(resultStr);
    I want to dispaly Inserted or Insertion Failed in Oracle Forms..
    As per Gerd Volberg suggestion, i had placed DBTest.jar in
    E:\DevSuite\forms\java\DBTest.jar
    and in formsweb.cfg the below jar is added..
    archive_jini=frmall_jinit.jar,DBTest.jar
    But in Fomrs Builder-->Program-->Import Java Classes-->Oracle
    org,ice,com and subnodes are available.
    But my jar is not available..
    Is my way is coorect?
    Pls provide soln..
    Thanks

  • Dot source/calling a function with switch from the cmd line

    Hi
    This is driving me crazy and I know its something really obvious.
    If I have an example script like so, called myexample.ps1
    [CmdletBinding()]
    param
    [Parameter(Mandatory=$false, HelpMessage="My Switch")]
    [switch] $Myswitch,
    [Parameter(Mandatory=$false, HelpMessage="Email Address")]
    [string] $email
    Function Main
    [CmdletBinding()]
    param
    [switch] $Myswitch,
    [string] $email
    if ($Myswitch)
    Write-Host "Switch Enabled"
    Write-Host "Email is $email"
    else
    Write-Host "Switch Disabled"
    Write-Host "Email is $email"
    Main -email $email #This is the line that I think is at fault
    I have two issues
    1) How do I correctly write the code so that the script can be called with either or both parameters. The switch ($Myswitch) is the one that is really causing me issues.
    2) Is invoking it the easiest method/best/most common method of calling it via a batch file
    Here's my understanding
    a) I could dot source it (. .\myexample.ps1) to load the functions into the current session, then call the function
    Main -email hello.com -Myswitch
    or
    Main -email hello.com
    b) or I could Invoke it, which I think is my preference as my final goal here is for it to be called via a batch file in a scheduled task
    & 'C:\Users\myusername\Desktop\MyExample.ps1' -email hello -myswitch
    or
    & 'C:\Users\myusername\Desktop\MyExample.ps1' -email hello
    Any push in the right direction will be appreciated :)

    Why the function?  Just call the file.  We don't "Invoke" scripts. Just call the script..
    # MyExample.ps1
    [CmdletBinding()]
    param(
    [Parameter(Mandatory=$false, HelpMessage="My Switch")]
    [switch] $Myswitch,
    [Parameter(Mandatory=$false, HelpMessage="Email Address")]
    [string] $email
    if ($Myswitch){
    Write-Host "Switch Enabled"
    Write-Host "Email is $email"
    }else{
    Write-Host "Switch Disabled"
    Write-Host "Email is $email"
    Now jsut call it like a normal script:
    .\MyExample.ps1 -email someemail -MySwitch
    It is as simple as that.
    If it has to be a function as in a library then you must either dot source or create a module.
    ¯\_(ツ)_/¯

  • How to call a function with parameters in ScriptStart function

    i am trying to call ScriptStart function from SUD dialog. This is how iam calling Call ScriptStart(path & "test.vbs","abc") abc is function which is written test.vbs. It is working. But when i want to pass some parameters to the abc function of test.vbs. It is not working why. can anybody suggest where i went wrong. I am calling the same function as Call ScriptStart(path & "test.vbs","abc(" & text1.Text & ")"). It is not working why ? Is the ScriptStart function only point to functions. it does not take any parameters or waht ?

    Hi abc421,
    Another option in addition to UserCommands would be to use ScriptInclude(path). If you execute a ScriptInclude(path) command at the beginning of your VBScript, then all the functions and Subs in the VBscript located at "path" are now available to you-- including passing parameters and receiving return values from functions. If you are calling a VBscript that uses only VBScript variables, then this is the preferred method.
    If instead you are calling a VBScript that uses global DIAdem variables declared in a VAS file (their variable names all end with the "_" character), then those parameters are already available at the subroutine called with ScriptStart(path, routine).
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to call form and pass parameter from OA Page

    Hi,
    I have one requirement to call a custom form from OA page by clicking the button and the same time i need to pass one parameter from this
    oa page to that form.
    how to do this by personalization?
    i surfed lot and i got some idea, some one said "pass the value as global variable and receive the global parameter when the new form instance trigger" .
    Can anyone please give about about this ?
    Thanks in advance,
    SAN

    This seems to be related to EBS and since this forum is dedicated to Fusion you might want to post the question to E-Business Suite forums and
    Support forum for EBS customizations.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • JavaFX : How to call java function that returns hashtable and manipulate

    I have a requirement to {color:#0000ff}create a java object in JavaFX script code{color}. Then call a java function using the created java object. The java function returns hashtable. Then traverse through each element of hashtable. Finally I need to create a similar structure in JavaFX.

    If you need to use a Java class that uses generics you need to take special steps. Since JavaFX does not support generics you need to create a java wrapper to hide the calls that use generics and call the wrapper class from FX.

Maybe you are looking for

  • QT won't open AVI's after moving to new MacBook

    Hi guys, I just upgraded to a MacBook, moving my files from a G3 iBook --including a bunch of short AVI's I'd made using a Canon digital camera. On the G3, QT opened these no problem. But on the MacBook, QT crashes whenever I try. What's up with this

  • Cheque Print issue

    Its happening often now that my user print some cheque and when the print comes out it is in the micro format and so many cheques are wrongly printed . I try to print it on simple paper is it was properly printed but after few practice it happens on

  • Java - Platform Independent, so why different results?

    This isn't a code specific topic, but I hope someone can still help me out with this. I've been developing a bit of code for a Java class that I'm taking, working in a small group with a few friends. I spend an entire weekend pounding out a GUI for t

  • Template moved to new site

    I started coding a a site on my server, nd now I transfered it to my clients server. First of all, I dont know how to get my site pages to link up to the template again! Second, I need to create an additional page and when I do "create new page from

  • A few questions to the abap development team...

    Dear Developers, I am submitting these questions to the ABAP development team at SAP regarding the language capabilities. Coming from the Java/C world I am wondering if you plan the following possible "evolutions" of the ABAP language :    - a real b