Call functions between classes

Hi all,
I have two java classes compiled into the DB in different schemas. How could I call the static method in classA from classB?
I suppose I need to get the schema name in there somehow, or is it just as simple as classA.method(arg1)
havent dared trying yet ;)

You need to change the resolver of the referencing class to include the schema of the referenced class.
When a class is created, whether directly by create java ddl or by loadjava it has an attribute known as a resolver which is essentially a search path for schemas to look in when resolving names referenced in the class. The resolver is a list of pairs of the form ((<pattern> <schema name>)(<pattern> <schema name>)...). When the class is resolved any name X that it references is bound to a class object by iterating over the resolver from left to right identifying each term in which the name of X matches the pattern and looking to see whether a class with the name of X exists in the schema identified by the term. If such a class exists, the search stops and the name X is bound to that class. If after looking at all the terms there is no class found, then a resolution error occurs. The pattern can either be an explicit name, or an explicit prefix followed by '*' or simply '*'. The latter is the usual pattern used, and matches any name. The default resolver given when a class is created without explicitly specifying an alternate resolver is ((* <current schema>)(* PUBLIC)). A class with this resolver will be able to resolve names in its own schema or in PUBLIC. In your case you want the referencing class to have a resolver like
((* <current schema>)(* <the other schema>)(* PUBLIC))
or some variation on this. An alternate resolver can be specified in loadjava using the -resolver argument, or in create or alter java ddl using the
resolver ((...)...) syntax. This is all documented in the java developers guide.

Similar Messages

  • Calling Function across Classes

    How do I call a function across classes?
    I have a primary class ("ChordLib.as") that contains a function that manages options for TileList component, that includes prescribing a custom Cell Rendering class, "MyRenderer".  I want to be able to call a function in the primary "ChordLib.as" class from the "MyRenderer.as" class.  Here is the function in "ChordLib" that refers to the "MyRenderer" class. Perhaps there is a way here to pass reference of the primary class into "MyRenderer"?
    // SET CHORD LIST  //////////////////////////////////////////
    public function setChordList(song:int):void {
    var dpChords:DataProvider = new DataProvider();
    var i:uint;
    // determine chord set
    if (song == -1) {
         activeChords = allChords;
    } else {
         activeChords = songChordSets[song];
    // fill dataProvider
    for(i=0; i<activeChords.length; i++) {
         var tt = activeChords[i];
         dpChords.addItem({ label:tt, source:ChordBar, data:i, scaleContent:true }); 
    chordList.dataProvider = dpChords;
    chordList.columnWidth     = 70;
    chordList.rowHeight     = 30;
    chordList.direction = ScrollBarDirection.VERTICAL;
    chordList.setStyle("contentPadding", 5);
    chordList.setRendererStyle("imagePadding", 0);
    chordList.scrollPolicy  = ScrollPolicy.ON;
    // set style for labels
    chordList.setRendererStyle("textFormat", textFormat1);
    // set the background skin
    chordList.setStyle("skin", lightBackground);
    //set the cell renderer
    chordList.setStyle("cellRenderer", MyRenderer);
    This last line ("chordList.setStyle("cellRenderer", MyRenderer);") refers to this custom class, that includes some event listeners:
    package {
       import fl.controls.listClasses.ICellRenderer;
       import fl.controls.listClasses.ImageCell;
       import flash.events.*;
       public class MyRenderer extends ImageCell implements ICellRenderer {
          public function MyRenderer() {
                this.buttonMode    = true;
              // set state skins to same skin so background is static
              setStyle("upSkin", lightBackground);
              setStyle("downSkin", lightBackground);
              setStyle("overSkin", lightBackground);
              setStyle("selectedUpSkin", lightBackground);
              setStyle("selectedDownSkin", lightBackground);
              setStyle("selectedOverSkin", lightBackground);
              // turn off text background by setting to 0
              setStyle("textOverlayAlpha", 0);
              setStyle("textPadding", 7);
                // event listeners
                this.addEventListener(MouseEvent.CLICK, clickHandler);
                this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
                this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
           // EVENTS
           private function clickHandler(event:MouseEvent):void {
           private function mouseOverHandler(event:MouseEvent):void {
           private function mouseOutHandler(event:MouseEvent):void {
    I want to insert calls to functions that are in the primary class (that contains the first function listed here), "ChordLib.as".
    How do I do this?

    In order for ClassA to call a function of another ClassB (or instance of it) it needs to be aware of two facts: 1) That ClassB does exist and 2) that ClassB has a particular function.
    Another approach could be establishing communication between classes via events.
    From you explanation it is not clear what you want to accomplish. Do you need to call a function on Class itself or an instance of this Class?
    If former - you need to create a static function and just call it:
    inside ClassB:
    public static function classBFunction()
    ClassA can call it:
    ClassB.classBFunction()
    If you need to call the function on an instance - you, naturally, need to instantiate the class and only then call the function.
    Say you have function inside ClassB
    public function classBAnotherFunction() - note that there is no word static
    There is another fork here: either you instantiate the ClassB inside ClassA or you pass a reference of the instance of ClassB into ClassA

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • How to call function module/ class method of another system.

    Suppose now i am working in System A. And i need to check the system Status of System B, System C, System D....
    my design is to provide an interface. and each system realize the interface individually.now my question is how cani call the interface, because they are in different systems.
    of course i know about the host name, port and logon information over these systems.
    who can give my some suggestions or other solutions.
    thanks in advance.
    Johnney.

    Hello,
    If u want to call a FM of the other system then that FM should be a RFC enable on one.
    <b>CALL FUNCTION func DESTINATION dest.</b>
    Effect
    Executes the function module from an external source (as a Remote Function Call or RFC); dest can be a literal or a variable.
    Depending on the specified destination, the function module is executed in another R/3 or R/2 System. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
    Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
    To maintain existing destinations, choose Tools -> Administration, Administration -> Network -> RFC destinations
    Note
    Under certain circumstances, an RFC may trigger a database commit. For this reason, RFCs must not be used between pairs of SQL statements that open and close a database cursor (such as SELECT... ENDSELECT).
    Vasanth

  • Call function or class from a loaded MC

    Hi,
    Can anyone tell me if its possible to call a function or class from within a loaded MC?
    mainMovie loads MC > MC calls function in a class of mainMovie
    if so, what is the best method?
    I've tried this from loaded MC but (of course) an error pops:
    movieClip(parent.parent).DO_THIS();
    Thanks for any "light" on this.

    It works fine!
    I'll try now to "sniff" into some class in main movieClip...
    Thanks

  • Calling function between subprojects and DLL in WINCE7

    We inherit a project develop using Platform Builder with WINCE7 and Visual Studio 2008. The project has a BSP, 5 sub-projects and a DLL. The problem is that when we add a function to the DLL Data Manager and try to call the new function from any of the subproject
    using an Data Manager object that is currently used in the subproject to call other functions on the Data Manager DLL, we get the following error:"Error 107 Configuration_Setting_Mapper.obj : error LNK2019: unresolved external symbol "public: void
    __cdecl Data_Manager::Configuration_Manager::Set_Default_TEST(void)" (?Set_Default_TEST@Configuration_Manager@Data_Manager@@QAAXXZ) referenced in function "public: bool __cdecl Configuration_Setting_Mapper::Set_UserName_Default(void)" (?Set_UserName_Default@Configuration_Setting_Mapper@@QAA_NXZ)
    Same error is received when we try to change the return type of any of the functions in the Data Manager DLL. Do we have to set a link between the Data Manager and the subproject? What could be missing?

    So the import library for the DLL needs to be updated (with the new function which you are exporting). Otherwise, it's as though you installed a new version of desktop Windows with new capabilities but used the old API libraries; your code won't link because
    the API library *you are using* doesn't match the DLL you want to call.
    Since your code compiles, you're obviously using the new header file(s).
    So, what to do? Without seeing the projects and understanding how the original structure was intended to work, I'm not sure we can say. You may be linking with a library in the SDK folder but not regenerating that library when the DLL changes, or you may
    not be generating a new import library when rebuilding the DLL.
    Paul T.

  • Sharing functions between classes

    I have Flash project that is set up something like this:
    myProject.fla
    - document class = myMenu.as
    - the document class imports a menu item from menuItem.as
    (import menuItem;)
    I have a function in myMenu.as that sets the text formatting
    for all the text fields on the page. I want to be able to use this
    same function in menuItem.as so that all the formatting is
    consistent & you only have to change it in one place. How do I
    access this function from both myMenu.as & menuItem.as?
    Thanks,

    Create another class say Utility with this function as
    public.
    And create object of this class in both menuItem and myMenu
    to use this function.
    This is just a rough idea how you can do it. but ideally that
    will depend on the class relationships/design patterns you are
    using.

  • Variable Functions (and Classes)

    Hi, I was wondering if ActionScript had some way to call functions and classes from variables, like they do in PHP:
    function funcname() {
         print "Potatoes come from tree";
    $function = "funcname";
    print $function;   // Prints out "funcname"
    $$function();      // Prints out "Potatoes come from tree"
    In case you don't know the syntax for PHP, you should know that anything perpended with a $-symbol is a variable. Is something akin to this possible with ActionScript?

    flash uses array notation to convert strings to objects:
    function funcname() {
         trace("Potatoes come from tree");
    var fS:String = "funcname";
    this[fS]();

  • Calling functions of the inner class in .java code file

    Hello,
    I created a .java code file in Visual J#.Net and converted it into
    the application by adding the "public static void main(String args[])"
    function.
    I have created the two classes one extends from Applet, and the other
    extends from Frame. The class which I inherited from the Frame class becomes
    the inner class of the class extended from the Applet. Now How do I
    call the functions of the class extended from Frame class - MenuBarFrame
    class. the outline code is
    public class menu_show extends Applet
    ------init , paint action function---------
    public class MenuBarFrame extends Frame
    paint,action function for Menu
    public static void main(String args[])
    applet class instance is created
    instance of frame is created
    Menu , MenuBar, MenuItem instance is created
    and all these objects added
    I have Created MenuBarFrame class instance as
    Object x= new menu_show().new MenuBarFrame
    ????? How to call the functions such as action of MenuBarFrame class - what
    should be its parameters??????
    }

    Here's how I would do it:
    interface Operation {
        public int op(int y);
    class X {
        private int x;
        public X(int x) {
            this.x = x;
        private class Y implements Operation {
            public int op(int y) {
                return x+y;
        public Operation createOperation() {
            return new Y();
        public static void main(String[] args) {
            X app = new X(17);
            Operation f = app.createOperation();
            System.out.println(f.op(-11));
    }Your code, however, has some serious "issues". You typically don't
    instantiate an applet class -- that's the job of the applet viewer or Java plugin
    your browser is using. If you instantiate the applet directly, you're going
    to have to supply it an AppletStub. Do you really want to go that way?
    Again, use an applet viewer or browser, or better yet, why write applets at all?

  • Problem Calling a Java class from PLSQL function

    We are calling a Java class through oracle function as
    FUNCTION CalculateAMW (contributorid IN Number,
    fromdate IN Date,OHorAnncoverage in Number,
    OHAnncoverage in Number,
    AppStatus in Number,
    Status in Number)
    RETURN Number
    AS LANGUAGE JAVA
    NAME 'AMWCalculations.calculateAMW
    (long,java.sql.Timestamp,long,long,long,long) return double';
    on execution of this function the sql prompt for the 1st time it is giving the output
    but
    if reexecute it is throwing and error ORA - 932 : Inconsistent
    datatypes.
    Recompiling the java class then it works for the 1st time and the next
    time
    we execute it throws error as explained above.
    What could be the problem.
    Thanks
    Nanda Kishore

    any idea???Yes, you are in the wrong forum, this is a Java forum, you have an ASP question, so i suggest you visit an ASP forum/site

  • Call function inside running class

    Hey All,
    i have a two question in classes.
    1- i have class and i called its before and its running on runtime. i need to call function inside this class from another class, but without call the first one again, because if i called it, it will run default class function again
    is this doable ?
    2- What super() mean ?
    Thanks a lot.

    this is the default call, and when i call the method by this way its will run the default class function before call the method.
    here my example:
    i need to call checkboxes  function in ChannelsMain class without pass by the grey script.
    Note: the call_cb is working and the trace is working
    so i now the class is running, i need to call the checkboxes without ( var ci:YourClass = new YourClass(); )
    package com.link
         import fl.controls.CheckBox;
         import flash.events.*;
         public class ChannelsMain
              var cbLength:uint = Main.PV.channel_id.length;
              public function ChannelsMain()
                   // constructor code
                   for (var i:int = 0; i < cbLength; i++)
                        var cb:CheckBox = new CheckBox;
                        cb.name = Main.PV.channel_id[i];
                        cb.label = Main.PV.channel_name[i];
                        cb.x = 50;
                        cb.y = 50 + i * 30;
                        cb.addEventListener(Event.CHANGE,call_cb);
                        Main.MS.addChild(cb);
                        //call xml function
                        if(i == cbLength - 1)
                             new ChannelsXML();
              private function call_cb(evt:Event)
                   trace(evt.currentTarget.name,evt.currentTarget.selected);
              public function checkboxes(evt)
                   trace(evt);

  • "Calling functions that are in a class based DLL (MFC extention DLL)"

    "Calling functions that are in a class based DLL (MFC extention DLL)"
    "Calling functions that are in a class based DLL (MFC extention DLL)
    I have a DLL written in VC++ using MFC exteintion DLL.
    The functions are used to extract information from a hardware card.
    eg.:
    class AFX_EXT_CLASS WSDevice : public cAsyncSocket
    This is a class in a DLL. There are a number of functions in this DLL that we need to call from Labview 5.0
    How do we call these functions?
    Normally (in VC++ /C++) we ceate a instance of this class like WSDeviceObj and use the function call :
    WSDeviceObj.fucntion name
    Kindly Help.
    Satish Narayana"

    You can create a wrapper dll from which you can call your dlls functions.
    Guidelines on how to create a dll that can communicate with LabVIEW are provided in the document "Using External Code in LabVIEW", which should be included with LabVIEW. You can download the document also from www.ni.com at:
    http://digital.ni.com/manuals.nsf/web_productcurre​nt/4F1447F7CD83D6D88625690D00637CED?OpenDocument
    Regards;
    Vargas
    www.vartortech.com

  • Direct approach for - Message class used in Call Function - possible?

    Hi All
    This is I guess a very simple question, but I could not find the solution.
    If i use the function: POPUP_TO_CONFIRM, I can hand over to the export some text symbols directly from the text elements.
    Example:
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = text-011
            text_question         = text-030
            text_button_1         = text-024
            icon_button_1         = 'icon_checked '
            text_button_2         = text-026
            icon_button_2         = 'icon_incomplete'
            default_button        = '2'
            display_cancel_button = ''
            start_column          = 25
            start_row             = 6
          IMPORTING
            answer                = answer.
    But I'm using a message class in this progamm.
    <b>So my question is, how can I use directly a message from the message class within the function?</b>
    I'm not asking for a 2-step approach (copy into text1 and set text1 to function). I would like to know how to use the text from the class directly into the function.
    Thanks
    Petra

    Hi
    May be this way.
       data : v_text1(72) type c,
              v_text2(72) type c,
           v_text3(72) type c,
              v_text4(72) type c.
        message i175(YVV) into v_text1.
        message i176(YVV) into v_text2.
        message i177(YVV) into v_text3.
        message i178(YVV) into v_text4.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = v_text1
            text_question         = v_text2
            text_button_1         = v_text3
            icon_button_1         = 'icon_checked '
            text_button_2         = v_text4
            icon_button_2         = 'icon_incomplete'
            default_button        = '2'
            display_cancel_button = ''
            start_column          = 25
            start_row             = 6
          IMPORTING
            answer                = answer.
    aRs

  • Which is the best way for a called function to identify caller class name.

    Which is the best way for a called function to identify the caller class name .
    1)Using sun.reflect.Reflection from called function
                    Class caller = Reflection.getCallerClass(2);
                    System.out.println("Caller Class Name ::"+caller.getName());2) Analyzing current threads stack trace from called function
                    StackTraceElement[] stElements=Thread.currentThread().getStackTrace();
                    System.out.println("Caller Class Name ::"+stElements[3].getClassName());Is there any alternate ways to achieve the same .Which is the best way ?
    Called function doesn’t have any arguments, I don’t want t pass any arguments from caller function to called function.
    Plz help.
    With kind regards
    Paul

    798185 wrote:
    Which is the best way for a called function to identify the caller class name .
    Is there any alternate ways to achieve the same.SecurityManager
        // 0 is the anonymous SecurityManager class
        // 1 is this class (also works in static context)
        // 2 is calling class
        static Class getClass(int i) {
            return new SecurityManager() {
                protected Class[] getClassContext() {
                    return super.getClassContext();
            }.getClassContext();

  • Calling function from deferint classes

    Dear all
    Am working in multiple classes application and i need to use from another class how i can
    Do that like :
    Function name sendBye in class SipMessage and i need to use that function in class callBox
    I try to use this code
    SipMessage sipM = new SipMessage();{
    sipM.callBox; but am receiving many Exceptions

    Javarcle wrote:
    but am receiving many ExceptionsThat sucks, dude. Maybe if you fix the problem, you'll stop getting the exceptions

Maybe you are looking for

  • Anyone in UK managed to buy a 160gb SATA Disk and which one did you get

    Im really struggleing to find a 160gb disk for my macbook! have they not been released in the UK? I have seen a HITACHI Travelstar 5K160 and A seagate disk too, but cant find anyone who has them in stock? Which is the better disk out of the 2 ? Thank

  • RF Screen Field-Data Type

    Hi,    Please let me know if the Data Type- STRG (Char string,variable length) is allowed for RF Screen. I want to use a field with Defined Len = 1000 CHAR & visible Len = 1. Pls let me know if you hv some other solution also... Regards, Rushikesh

  • How do i find my most recent movie rentals?

    how do i find my most recent movie rentals? I'm talking about the ones that were 30 days old and went away. I forgot one of the titles and i'm trying to find the list of what I rented

  • Movie rental on Apple TV

    I rented a movie on my Apple TV, and it still says "ready to watch in 1 min" more or less 15 min ago. What should I do?

  • No circle around the image of man on homescreen.

     Hello there,  The circle around the man on the homescreen which you can see on all advertisements does not appear no matter how long i walk or run. Something i need to set up? Thank you. Solved! Go to Solution.