Calling a private function when inside another class?

Can't help it but im curious how classes seem to be able to
call private functions inside other classes. I'm mainly thinking
about the addEventListener() here. When adding a listening function
to a class, that function can be private, and yet it seems to be
called magically somehow. Or maybe its all internal? I dunno.
Anyone? :D

Hi Kenchu1,
You can grab a copy of the open source API here:
http://www.baynewmedia.com/download/BNMAPI10.zip
(feel free to drop by
the main site for documentation as well :) ). The main class
is the
Events class, "broadcast" method. This method broadcasts
events in a
decoupled fashion, meaning that listeners can listen to
messages that
aren't bound to a specific sender. The AS3 version works in
much the
same way except that I still haven't fully fleshed out the
cross-SWF
communication that this version can do (broadcast across all
movies on
the same computer using LocalConnection).
Basically, the broadcaster works like this:
1. Add event listener and bind to function A (called from
within the
class so the reference is available)
2. Event listener pushes this into the listener array. It was
provided
by the class so the reference is valid and is now a part of
the events
class as well.
3. Broadcast runs through all associated events when it comes
time to
broadcast and calls the function by using the array
reference:
this.listeners[message].call(classInstance,someParameter);
In other words, the class that adds the listener "allows"
the event
broadcaster to use the reference because it passes it out.
You can do
the same thing by calling:
someOtherclass.functionRef=this.privateFunction
someOtherClass is the class that will store the private
reference,
functionRef is some variable to hold the reference, and
privateFunction
is the private function. Then, in someOtherClass, you can
call:
this.fuctionRef(someParameter);
Hope this helps.
Patrick
Kenchu1 wrote:
> Patrick B,
> exactly! Something like that is what im looking for. I
have my own rather
> simple system right now with listeners and classes
calling these, but since i
> dont know how to call a private function, i had to make
all the listening
> classes functions public - something id rather avoid.
Exactly how did your
> event broadcasting system work? Oh, and we're talking
AS3 btw.
>
> How do i call a function via a reference? (to the
function? To what?)
>
http://www.baynewmedia.com
Faster, easier, better...ActionScript development taken to
new heights.
Download the BNMAPI today. You'll wonder how you ever did
without it!
Available for ActionScript 2.0/3.0.

Similar Messages

  • Calling a Function Pool inside a Class

    Hi,
        I want to call a Function Pool inside a Class Method. I am getting an Error that 'Report or Program Statement already exists' when I call the function pool in the method. can anybody help me on how to call a Function Pool inside a class method.

    Hello Krish
    Based on your error description I assume that you have tried to "insert" the function pool program (e.g. function group ZFUNC -> SAPLZFUNC) into your class.
    You cannot do that. The explanation for the error message is a following:
    - The class contains already a program statement (CLASS-POOL). If there is somewhere in the class an additional program statement (e.g. FUNCTION-POOL) you will get the error.
    In addition, you cannot "call" a function pool. Instead you can always call the function modules of your function group.
    Regards
      Uwe

  • *Can we call a Standard Function Module inside a Zfunction module ?*

    Can anyone please help me know whether we can call a Standard Function Module inside a Zfunction module ?
    I tried the same (No syntax error) BUT when i activate the zFunction Module it throws the error:-
    +'' REPORT/PROGRAM statement missing, or program type is INCLUDE. " +

    Yes, I got the Answer -
    We Can we call a Standard Function Module inside a Zfunction module.
    But we need to make sure that the Function Groups are activated.
    FUNCTION ZFM_TEST_NESTED_FM.
    ""Local Interface:
    *"  EXPORTING
    *"     REFERENCE(EX_CONVERT_UPPER_CASE) TYPE  STRING
    CALL FUNCTION 'TERM_TRANSLATE_TO_UPPER_CASE'
      EXPORTING
      LANGU                     = SY-LANGU
        TEXT                         = 'gaurav'
    IMPORTING
        TEXT_UC                   = EX_CONVERT_UPPER_CASE
    EXCEPTIONS
       NO_LOCALE_AVAILABLE       = 1
       OTHERS                                    = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFUNCTION.

  • Need help to call a simple function from within another function?

    I created a movieclip which has a function in its one and only frame.
    function testx() {
    x = x+2};
    This movieclip is in the main timeline (in its own layer).
    In another layer on the timeline I have created a single keyframe with a button instance called myBtn
    myBtn.onRelease = function() {
    var x
    x =2
    testx(2);
    trace (x);
    What I want to do is call the function in the movieclip frame from the button press function. However, I can't seem to reference it properly.
    Can anyone help me to basically call a simple function from within another function?

    Yes am using CS4.  Have saved it as CS3 now.  Ok the file is somewhat complicated and what I am testing is not what I ultimately want to do but if I can pass that variable I can figure it out.  In terms of describing the file I think the only parts of importance are what I put in my previous post (please let me know if there is something I should be telling you that I have missed).  I am 99.9% sure that I am using the correct instance name.
    Scene1 Layer3 Frame1 has the function call for the button.
    myBtn.onRelease = function() {
    var x
    x = 2
    testx(2);
    trace (x);
    Slideshow layer //Actions Frame1 has the function
    function testx(x) {
    x = x+2};
    thank you so much for helping me.

  • Calling a function inside another class

    I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?
    Thanks a lot for any help!!!
    package
         import flash.display.MovieClip;
         public class ThumbGridMain extends MovieClip
              private var grid:CreateGrid;
              public function ThumbGridMain():void
                   grid = new CreateGrid();
              public function testFunc():void
                   trace("testFunc was called");
    package
         import flash.display.MovieClip;
         public class CreateGrid extends MovieClip
              public function CreateGrid():void
                   parent.testFunc();

    kglad,
    Although I agree that utilizing events the way you attempted in your suggestion is better for at least a reason of eliminating dependency on parent, still you code doesn't not accomplish what Brian needs.
    Merely adding event listener to grid instance does nothing - there is no mechanism in the code that invokes callTGMFunction - thus event will not be dispatched. So, either callTGMFunction should be called on the instance (why use events - not direct call - in this case?), or grid instance needs to dispatch this event based on some internal logic ofCreateGrid AFTER it is instantiated - perhaps when it is either added to stage or added to display list via Event.ADDED. Without such a mechanism, how is it a superior correct way OOP?
    Also, in your code in ThumbGridMain class testFunc is missing parameter that it expects - Event.
    Am I missing something?
    I guess the code may be (it still looks more cumbersome and less elegant than direct function call):
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         public class ThumbGridMain extends MovieClip
             private var grid:CreateGrid;
             public function ThumbGridMain():void
                 grid = new CreateGrid();
                 grid.addEventListener("callTGMFunction", testFunc);
                 addChild(grid);
            // to call a CreateGrid function named cgFunction()
             public function callCG(){
                 grid.cgFunction();
             public function testFunc(e:Event):void
                 trace("testFunc was called");
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         import flash.events.Event;
         public class CreateGrid extends MovieClip
             public function CreateGrid():void
                 if (stage) init();
                 else addEventListener(Event.ADDED, callTGMFunction);
             // to call a TGM function
             public function callTGMFunction(e:Event = null):void
               // I forgot this one
                removeEventListener(Event.ADDED, callTGMFunction);
                this.dispatchEvent(new Event("callTGMFunction"));
            public function cgFunction(){
                 trace("cg function called");
    I think this is a case of personal preference.
    With that said, it is definitely better if instance doesn't rely on the object it is instnatiated by - so, in this case, either parent should listen to event or call a function directly.

  • Calling a TextFields get method from another class as a String

    This is my first post so be kind....
    I'm trying to create a login screen with Java Studio Creator. The Login.jsp has a Text Field for both the username and password. JSC automatically created get and set methods for these.
    public class Login extends AbstractPageBean
    private TextField usernameTF = new TextField();
    public TextField getUsernameTF() {
    return usernameTF;
    public void setUsernameTF(TextField tf) {
    this.usernameTF = tf;
    private PasswordField passwordTF = new PasswordField();
    public PasswordField getPasswordTF() {
    return passwordTF;
    public void setPasswordTF(PasswordField pf) {
    this.passwordTF = pf;
    My problem is in trying to call these methods from another class and return the value as a string.
    Any help on this matter would be greatly appreciated.

    the method returns the textfield, so you just need to get its text
    import java.awt.*;
    class Testing
      public Testing()
        Login login = new Login();
        System.out.println(login.getUsernameTF().getText());//<----
      public static void main(String[] args){new Testing();}
    class Login
    private TextField usernameTF = new TextField("Joe Blow");
    public TextField getUsernameTF() {
        return usernameTF;
    }

  • Calling results of a method from another class

    Very very new to Java, so apologies for the lack of basic knowledge. I am making a programme with 3 classes. One class gathers details about a module. Another about the results of this module (which requires some of the information inputted for the first class). For some reason I cannot find how to use results created in the first class in this second class. How do you call the results of a method from one class in another class?
    Thanks.

    Thank you.
    I am given the following information:
    '_ModuleRecord_
    This class is used to record information about a module taken by a single student. It has a constructor that takes three parameters:
    a Module,
    an int representing the examination mark achieved by a student, and
    an int representing the coursework mark achieved by a student.
    The class has another constructor that takes a single Module parameter.'
    and the code looks like this:
    public class ModuleRecord
      public ModuleRecord(Module m, int eMark, int cMark)
      public ModuleRecord(Module m)
      } I am a bit confused by the whole thing to be honest. I assume that the Module is referring to the other class, but how do I forge the link between them here?

  • Problems calling LabVIEW VI through ActiveX inside another LabVIEW VI

    Hi everybody,
    basically I would like to create an ActiveX to be inserted in a LabVIEW VI which at its turn would call another LabVIEW VI.
    I have choosen Visual Basic to create this ActiveX, being the main section code:
    Dim lv As LabVIEW.Application
    Dim vi As LabVIEW.VirtualInstrument
    Dim names(0 To 1) As String, values(0 To 1) As Variant
    'Assign an object reference to VI
    Set lv = New LabVIEW.Application
    'Assign an object reference to VI
    Set vi = lv.GetVIReference(lv.ApplicationDirectory & "\Examples\General\Strings.llb\Parse Arithmetic Expression.vi")
    vi.ShowFPOnCall = False 'Open front panel if requested
    'Initialize the variables & define the strings corresponding to the VI connector labels.
    names(0) = "Arithmetic Expression": values(0) = "1+1"
    names(1) = "Result"
    'Call the VI
    vi.Call names, values
    So, when this ActiveX executes this code sequence it locks when creating the "LabVIEW. Application" object. I have tested this ActiveX from another client application (Internet Explorer) and it works perfectly, so the problem is located in the creation of ActiveX from LabVIEW. Do I need to do anything special in my code or simple it cannot be done what I want to do?
    Thanks !!!
    Jesus Valero
    Plataforma Solar de Almeria.

    Exactly, but really the code of above it's only an example that I want to do. I'm trying something more sophisticated.
    I want to create an ActiveX control that could work as stand alone executation with the ability of directly get some indicator values from its LabVIEW VI container and depending of those values, set the control values of others LABVIEW VIs. I really know that within LabVIEW itself I can get/set those indicators/controls, but with this method I think that the diagram block of the LabVIEW VI container can be more simple.

  • When extending another class...?

    I have made a BinaryTree class, tested it and everything and it all works.
    Now, I have just made an AVLTree class. So, I want all the methods in the BinaryTree class to be the same as in the AVL class except the add method which I wanted to override.
    So, I made the BinaryTree class abstract, and then extended the BinaryTree class in the AVL class.
    So I thought that by doing this all I had to do was put in the add method and change the code and then I could use all the methods in the BinaryTree class.
    Well it seems that I can, except that none of it works correctly because of private attributes. For example, my size doesn't update in my new add method and I can't figure out why. I have a private int size in both classes but it doesn't work. Not only that but my root node isn't working either.
    I'll post some code here and hopefully someone knows what I'm doing wrong.
    package avlTree;
    * @author 383259
    public class AVLTree extends BinaryTree
         private int size;
         private BSTNode root;
         private String side;
         public AVLTree()
              super();
          * @param element
         public AVLTree(Comparable element)
              super(element);
          * @param element
          * @param left
          * @param right
         public AVLTree(Comparable element, BSTNode left, BSTNode right)
              super(element, left, right);
          * @param element
          * @param left
          * @param right
         public AVLTree(Comparable element, BinaryTree left, BinaryTree right)
              super(element, left, right);
    private BSTNode addToTree(Comparable o)
              try
                   boolean status = false;
                   if(isEmpty())
                        System.out.println("yes");
                        status = true;
                        root = new BSTNode(o);
                        size++;
                        setRoot(root);
                        return root;
                   else
                        System.out.println("yes");
                        BSTNode currNode = root;
                        BSTNode newNode = new BSTNode(o);
                        while (status == false)
                             if(newNode.compareTo(currNode.getElement()) == 1)
                                  if (currNode.getRight() == null)
                                       currNode.setRight(newNode);
                                       newNode.setParent(currNode);
                                       size++;
                                       side = "right";
                                       status = true;
                                       return newNode;
                                  else
                                       currNode = currNode.getRight();
                             else if(newNode.compareTo(currNode.getElement()) == -1)
                                  if (currNode.getLeft() == null)
                                       currNode.setLeft(newNode);
                                       newNode.setParent(currNode);
                                       size++;
                                       side = "left";
                                       status = true;
                                       return newNode;
                                  else
                                       currNode = currNode.getLeft();
                             else
                                  status = true;
                                  return null;
                        return null;
                   catch (ClassCastException cce)
                        return null;
                   catch (NullPointerException npe)
                        return null;
                   catch (IllegalArgumentException iae)
                        return null;
         }That private, addToTree method is actually the same as the add method in the binary tree, but is only a small part of the add method in the AVLTree. Anyway, my private root node attribute and size attribute aren't updating for some reason or another, and I cannot figure out why.

    So, I made the BinaryTree class abstract,And you did that why exactly?
    So I thought that by doing this all I had to do was
    put in the add method and change the code and then I
    could use all the methods in the BinaryTree class. Which is correct. Minus the private stuff, as you found out. That's what private means, after all.
    Well it seems that I can, except that none of it
    works correctly because of private attributes. For
    example, my size doesn't update in my new add method
    and I can't figure out why. I have a private int size
    in both classes but it doesn't work. Not only that
    but my root node isn't working either.I guess it doesn't work because you now have two size variables and constantly use the wrong one. Make size protected, or better, provide a protected setter for the size. Do the same for other private attributes you need to access.

  • Help with calling a java application from inside another one

    Hello!
    I am having this problem which is getting on my nerves and dont know how to solve..
    I want to call from my java application, another java application. So i use the exec command. Then i want to read the output of this execution from my own application, (the "parent" process).
    But it doesn work properly. Something seems to happen and i dont get the whole output.
    The java program i want to call is created for running an application created with Matlab java builder.
    This program works when called from cmd, but seems not to work when called from inside a java application.
    The code of my java application is:
    Runtime rt = Runtime.getRuntime();
    Process child;
    // The java class getmagic is a special kind of java file that uses classes that work in matlab. It uses a component (.jar) file that is created from matlab java builder. thats why it wants the -classpath and the rest options.
    //I hope you wont get messed up in here.
    String[] callAndArgs = {"java","-classpath",".;C:\\Program Files\\MATLAB\\R2006b\\toolbox\\javabuilder\\jar\\javabuilder.jar;..\\MagicDemoComp\\magicsquare\\distrib\\magicsquare.jar -Djava.library.path=C:\\Program Files\\MATLAB\\R2006b\\bin\\win32;","getmagic","4"};
    try{
    child = rt.exec(callAndArgs);
    InputStream is = child.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line;
    while ((line = br.readLine()) != null)
    System.out.println(line);
    is.close();
    System.out.println(child.waitFor());
    System.out.println("Finished");
    }catch(IOException e) {
    System.err.println("IOException starting process!");
    }catch(InterruptedException e) {
    System.err.println("InterruptedException starting process!");
    The java program (getmagic) thats uses matlab gives the following output (after some time) when called in cmd with argument 4
    Magic square of order 4
    16 2 3 13
    5 11 10 8
    9 7 6 12
    4 14 15 1
    My program shown above only prints:
    Magic square of order 4
    1
    Finished.
    Do i do something wrong? How can i get the rest of the output???
    Thank you very much in advance,
    Stacey
    PS: I am sorry for the length of my post.

    Hello CaptainMorgan08, thanx for the instant reply.
    I tried, but no, i cant.
    Because i cannot include this java aplication that uses matlab into my application, cause 1) it needs special arguments in the compiler and during execution so it can be run and 2) it uses classes that java doesnt have. only the java-like matlab code.
    For example it uses:
    import com.mathworks.toolbox.javabuilder.*;
    import magicsquare.*; //the component which is made from matlab java builder.
    So i cannot compile it with my application!
    If you know of a way, please let me know!
    I know i might be missing something.. something that is obvious to you.. but i ve been working days=nights hardly no sleep..so you can excuse me if i say something foolish..
    Message was edited by:
    Stacey_Gr

  • Calling a java application from within another class

    I have written a working java application that accepts command line parameters through public static void main(String[] args) {} method.
    I'm using webMethods and I need to call myapplication from within a java class created in webMethods.
    I know I have to extend my application class within the webMethods class but I do not understand how to pass the parameters.
    What would the syntax look like?
    Thanks in advance!

    why do you want to call the second class by its main method ??
    Why not have another static method with a meaningfull name and well defined parameters ?
    main is used by the jvm as an entry point in your app. it is not really meant for two java applications to communicate with each other but main and the code is not really readable.
    Have a look at his sample
    double myBalance = Account.getBalance(myAccountId);
    here Account is a class with a static method getBalance which return the balance of the account id you passed.
    and now see this one, here Account has a main method which is implemented to call getBalance.
    String[] args = new String[1];
    args[0] = myAccountId;
    Account.main(args);
    the problem with the code above is
    main doesn't return anything so calling it does do much good. two the code is highly unreadable because no one know what does the main do... unlike the sample before this one where the function name getBalance clearly told what is the function doing without any additional comments.
    hope this helps.... let me know if you need any additional help.
    regards,
    Abhishek.

  • Calling a backend bean method from another class

    Hi,
    I'm new in JSF & in this forum so maybe this question is already aswer.
    My problem is that I made a jsf component to deal with a tree menu. The resources in the leaf nodes of the menu are stored in a action calling pattern (i.e.: #{myBean.myMethod}) & I'm looking for a way to bind & execute the call from the class of the component that treats the events.
    I suppose that I need to get the current instance of the context, get the bean location, instance it & invoke the method, but I don�t know how.
    I have another more question, may this resource invocation have any kind of undesirable side effect, I meen, it's me & not the faces context who is making the call so I'm not sure if that the best way to solve the problem.
    Thanks in advance.

    If I understand what you're saying correctly... you have a component which enables a user to select an action (leaf nodes in the menu). You are processing this selection in your component and now have a EL expression that looks like #{myBean.myMethod}. You now need to know how to use that expression from Java code to invoke it. Is that correct?
    If so:
    FacesContext ctx = FacesContext.getCurrentInstance();
    MethodBinding mb = ctx.getApplication().createMethodBinding("#{myBean.myMethod}", new Class[] {});
    mb.invoke(ctx, null);
    This should do what you want. If you need to pass arguments to the method, you can do that as well... you need to pass in the types via the Class[], and the objects via an Object[] instead of null.
    Note also that the API's for EL change for JSF 1.2 to the standard EL API's, however, the older API's (above) are still supported.
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • Calling a non-static method from another Class

    Hello forum experts:
    Please excuse me for my poor Java vocabulary. I am a newbie and requesting for help. So please bear with me! I am listing below the program flow to enable the experts understand the problem and guide me towards a solution.
    1. ClassA instantiates ClassB to create an object instance, say ObjB1 that
        populates a JTable.
    2. User selects a row in the table and then clicks a button on the icon toolbar
        which is part of UIMenu class.
    3. This user action is to invoke a method UpdateDatabase() of object ObjB1. Now I want to call this method from UIMenu class.
    (a). I could create a new instance ObjB2 of ClassB and call UpdateDatabase(),
                                      == OR ==
    (b). I could declare UpdateDatabase() as static and call this method without
         creating a new instance of ClassB.With option (a), I will be looking at two different object instances.The UpdateDatabase() method manipulates
    object specific data.
    With option (b), if I declare the method as static, the variables used in the method would also have to be static.
    The variables, in which case, would not be object specific.
    Is there a way or technique in Java that will allow me to reference the UpdateDatabase() method of the existing
    object ObjB1 without requiring me to use static variables? In other words, call non-static methods in a static
    way?
    Any ideas or thoughts will be of tremendous help. Thanks in advance.

    Hello Forum:
    Danny_From_Tower, Encephalatic: Thank you both for your responses.
    Here is what I have done so far. I have a button called "btnAccept" created in the class MyMenu.
    and declared as public.
    public class MyMenu {
        public JButton btnAccept;
         //Constructor
         public MyMenu()     {
              btnAccept = new JButton("Accept");
    }     I instantiate an object for MyMenu class in the main application class MyApp.
    public class MyApp {
         private     MyMenu menu;
         //Constructor     
         public MyApp(){
              menu = new MyMenu();     
         public void openOrder(){
               MyGUI MyIntFrame = new MyGUI(menu.btnAccept);          
    }I pass this button all the way down to the class detail02. Now I want to set up a listener for this
    button in the class detail02. I am not able to do this.
    public class MyGUI {
         private JButton acceptButton;
         private detail02 dtl1 = new detail02(acceptButton);
         //Constructor
         public AppGUI(JButton iButton){
         acceptButton = iButton;
    public class detail02{
        private JButton acceptButton;
        //Constructor
        public detail02(JButton iButton){
          acceptButton = iButton;
          acceptButton.addActionListener(new acceptListener());               
       //method
        private void acceptListener_actionPerformed(ActionEvent e){
           System.out.println("Menu item [" + e.getActionCommand(  ) + "] was pressed.");
        class acceptListener implements ActionListener {       
            public void actionPerformed(ActionEvent e) {
                   acceptListener_actionPerformed(e);
    }  I am not able to get the button Listener to work. I get NullPointerException at this line
              acceptButton.addActionListener(new acceptListener());in the class detail02.
    Is this the right way? Or is there a better way of accomplishing my objective?
    Please help. Your inputs are precious! Thank you very much for your time!

  • Can we call a javascript function from backing bean class?

    I have a requirement. In a multiselect table, when users selects some rows and clicks a button. Depending upon some condition, an alert box should appear with 2 buttons 'Yes' and 'No'. On clicking yes, certain field values in the selected rows of table should change. On clicking no, the alert box should close. As far as i know alert box can be done only in JS.
    Please help me, if a javascript function can be called in backing bean method or suggest some way where alert boxes can appear through ADF.

    I need to go back to the backing bean as i need to iterate through each selected row of the table in a method( method written for command button) and then if atleast one of the selected rows has job field='Manager', then an alert box needs to be displayed. If none of the rows have job field as 'manager', alert box should not be displayed.
    If I write the function for onclick, i cannot iterate through the selected rows of the table in JS function.
    Please suggest a way to do this.

  • Calling PL/SQL function from external Java class

    I was wondering if I was able to call a pl/sql function from an external java class? If so, would you be able to tell me briefly on how to go about it. I know I can call java methods that are internally stored in the db from pl/sql, but I was hoping I could call pl/sql from external java. Thanks,
    Kelly

    Ok, I made the changes, but I'm now getting the following error:
    Error code = 1403
    Error message = ORA-01403: no data found
    ORA-06512: at "IOBOARD.GETSTATUS", line 6
    ORA-06512: at line 1
    The ora-01403 I don't understand because there is data for the name Kelly.Brace.
    ora-06512 error: at string line string.
    Here's what the code looks like after I made the changes:
    String sql = "{?=call ioboard.GetStatus(?)}";
          // create a Statement object
          myStatement = myConnection.prepareCall( sql );
          myStatement.setString( 1, "Kelly.Brace" );
          myStatement.registerOutParameter(2, java.sql.Types.LONGVARCHAR );
          // create a ResultSet object, and populate it with the
          // result of a SELECT statement
          ResultSet myResultSet = myStatement.executeQuery();
          // retrieve the row from the ResultSet using the
          // next() method
          myResultSet.next();
          // retrieve the user from the row in the ResultSet using the
          // getString() method
          String status = myResultSet.getString(1);
          System.out.println("Hello Kelly, your status is: " + status);
          // close this ResultSet object using the close() method
          myResultSet.close();Here's what the function looks like:
    CREATE OR REPLACE FUNCTION GetStatus( user_name in varchar2)
    RETURN VARCHAR2
    is
    v_status varchar2(10);
    BEGIN
    select iob_location into v_status
    from ioboard.iob_user
    where iob_username = user_name;
      RETURN( v_status);
    END;This works perfectly in the SQL Window:
    select iob_location
    from ioboard.iob_user
    where iob_username = 'Kelly.Brace';

Maybe you are looking for

  • Office Web App error

    I have setup my Office Web App Environment following the following article.  http://technet.microsoft.com/en-us/library/ff431687.aspx#oauth This is a production environment with HTTPS.  I can go to https://URL/hosting/discovery  and it pulls up the X

  • How can I input Chinese in the Playbook?

    How can I input Chinese in the Playbook?  such as in browers and contact

  • SaxParser error while using WSIF bindings in BPEL

    Hi All, I am using WSIF bindings in BPEL to invoke a java class. This java classs is using Jersey Client. For this I have imported relevant jersey jar files version 1.1.4.1. My java class is getting invoked and even the jersey client jars are also re

  • Is there any block in the Labview similar to that of clock block available in Matlab ?

    Hi guys, i have generated a pulse in the matlab using the embedded block having some code in it and it takes the clock as one of it's input as shown in the figure. Now i want to do the same in the Labview, but here i need a block which is exactly sim

  • Backup Destination Drive full after updating

    I have an external Disk Drive that is 150GB in size. I'm trying to setup a daily backup for a single folder that contains all my media which is 116GB in size. I've tried several times to back this up and it works correctly for first Backup but then a