How to use classes from different user defined Packages

well i made 2 packages... one containing employee class and realted matter and other contaning bankaccounts and bank related work... now how can i use them in an another.. i know about the import statement but still couldn't make it work.... now suppose iam makin a obejct of employee class and passing in name and salary and all in the constructor... now i want that when i create the bankaccount class then the name of the employee should be passed to the bankaccount class so that it can assigen a account no. .. now how do i do this as when i create a object of employee class its made at runtime.. and if i create a object of bankaccount.. how wil it take that name as before goin to bank account i should already have a list of emplyees and then this list should be worked upon by the backaccount class to assign the accountno.s
Hope my question was clear... would appriciate a explanation and guidance!!!

Thank you so much ... i was able to solve the problem... i passed the object in the constructor of the accounts class and it all worked out the way i wanned... thank you so much... it wasn't that difficult but the idea was just not clicking...this place is wonderful... everyone rocks!!! and so greatful about all the help.. please keep up the good work and even i will try to contribute as much as possible!!

Similar Messages

  • How to make an applet load user-defined package?

    How to have an applet load user-defined package?
    I have packages in their own directories, and the applet compiles and links with them, by use of CLASSPATH env variable. But when it comes time to run, it ignores that and does not know where the classes (in the packages) are.
    If I don't use packages and put all code in one directory, runs fine. If I use an application, I can link with and load my packages.
    I know applets can't use things like CLASSPATH for security reasons, but still, they should be able to be compiled out of several packages, why do I have to put all code together??

    OK, for reference for future newbies, here's the answer:
    use CODEBASE attribute in your html file (if on Windows server, don't use drive letter but relative path to .html file, Unix style, and put all your .class files beneath that, for example, in your .html file
    <applet
    CODEBASE="..\class
    and then have package bar Bar.class file, in ..\class\bar

  • HT3819 How to use homesharing between different user accounts on the same iMac?

    I find plenty of articles about homesharing on iTunes between computers, but not between two different user accounts on the same iMac.  Any advice or direction to an existing artical is greatly appreciated.  I'm knew to the Mac and still have Windows on the brain.
    I am trying to share iTunes music and movie purchases between my user login and my wife's.
    Thanks

    Hello careymp1017,
    This can be achieved, but will not utilize HomeSharing. Further information and steps can be found in the following article.
    iTunes: How to share music between different accounts on a single computer
    http://support.apple.com/kb/HT1203
    Cheers,
    Allen

  • How to Use Sequence Object Inside User-defined Function In SQL Server

    I'm trying to call sequence object inside SQL Server user-defined function. I used 
    Next Value for dbo.mySequence  to call the next value for my sequence created. But I'm getting an error like below.
    "NEXT VALUE FOR function is not allowed in check constraints, default objects, computed columns, views, user-defined functions, user-defined aggregates, user-defined table types, sub-queries, common table expressions, or derived tables."
    Is there any standard way to call sequence inside a function?
    I would really appreciate your response.
    Thanks!

    The NEXT
    VALUE FOR function cannot be used for User Defined function. It's one of the limitation.
    https://msdn.microsoft.com/en-us/library/ff878370.aspx
    What are you trying to do? Can you give us an example and required output?
    --Prashanth

  • How to use classes from an existing outside library ?

    Dear People,
    I added a library to use classes already built.
    In JBuilder7 I went to Tools | ConfigureLibraries
    and added the objectdraw library. At the left when I look in the
    directory structure under User Home is "objectdraw" so I did
    add the library correctly but when I put in the coding a try
    to run it, the error messages say:
    "MakeBox.java": Error #: 200 : <identifier> expected at line 8,
    which is the line : public void MakeBox()
    The entire code is :
    package stan_e_makebox;
    import objectdraw.*;
    import java.awt.*;
    public class MakeBox extends WindowController
    void public MakeBox()
    public void onMousePress(Location point)
    new FilledRect(40,80,30,20,canvas);
    public static void main(String[] args)
    new MakeBox();
    Thank you in advance
    Stan

    oo sorry,
    this is the constructor i assume, so should be
    public MakeBox()

  • How to use attributes from different context nodes in one view?

    I am VERY new to the concept of CRM and currently working on creating an alternate version of the BP_HEAD_SEARCH. With help from SAPPRESSs book 'SAP CRM Web Client' i was ble to create my own simple Z-component.
    However after going back and forth the book and the forum (including this [article|https://wiki.sdn.sap.com/wiki/display/CRM/Howtoaddanexistingfieldtoasearchpageofadifferent+component]) i was not able to find a solution to my problem. My current search uses BuilHeaderAdvancedSearch as context node for searching. But the search should also be able to use attributes from BuilActivity, which is directly related to BuilHeader. I can't seem to find a way to get attributes from BuilActivity into the search window of my component without having to change SAP-Standard.
    Is this really the only way? Please advise on possible code and insertion point.

    Any suggestions?

  • Using DataSource from a user-defined thread

    Using Websphere 5.1.1, I have a servlet that launches a special thread, which accesses a database (through a DataSource).
    It's unusual, but it's a requirement.
    So it would in the lines of (ommitting error handling):
    public class MyServlet extends HttpServlet
        public void doGet(HttpServletRequest req, HttpServletResponse resp){
            InitialContext ctx=new InitialContext();
            final DataSource ds=(DataSource)
                   ctx.lookup("java:comp/env/myDataSourceRef");
            new Thread(){
                 public void run(){
                      Connection con=ds.getConnection();
                      ... run some JDBC code
                      con.close();
            }.start();
    }When running this, I get a warning :
    "J2CA0075W: An active transaction should be present while processing method initializeForUOW"
    According to IBM, that follows J2EE spec, because
    Eventually (i.e. J2EE 1.4) spun threads from a Servlet accessing a database outside of a transaction will not be supported(Quoting from: http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q=J2CA0075W&uid=swg21109248).
    But then, if the problem is a lack of transaction, how can one guarantee a transaction is present ?
    I have already tried the following, in vain:
    1) Making sure the datasource is registered as a web reference (in web.xml), with transaction isloation level set to READ_COMMITTED.
    2) Invoking con.setAutoCommit(false), which is probably not recommended, but I tried it anyway.
    3) I've considered moving the call "con=ds.getConnection" out of the thread, and into "doGet". However, my application logic won't allow it.
    Would anyone happen to know how to make sure such a transaction is present ?
    Thanks very much.

    A map with a constant or mapping input parameter that uses a function should call the function one time.
    There was a bug(5663912) in 10.2.0.1 that was fixed in 10.2.0.2. If the SQL statement is using a PLSQL variable which has the initial value of the function result then this is working OK, if the SQL statement calls a 'GET_' function which in turn executes your function then you are not using the fix.
    Cheers
    David
    (The intermediate code generation shown in the mapping editor is not the full blown code generator).

  • HOW to use class in different file???

    hi
    I want to use other class
    and write them separately in different .java file
    but when i compile the one who call the class
    it says it cannot resolve the symbol, which is the class name I call
    Can anyone help me

    it says it cannot resolve the symbol, which is the
    class name I callYep. This is a "classpath" problem. You have to tell Java where all the class files are that you'll be using. The simplest way to do this when you're starting out is to make sure all your files are in the same directory and compile using the following command:
    javac -classpath . *.javaTake careful note of the spaces and "." after the "-classpath". This tells Java to look in the current directory for your class files (naturally, you'll need to be in the same directory as your *.java files when you run that command).
    You may also want to check out the beginner tutorials available on this site. They'll help out a bunch!
    Good luck!

  • How to use user-defined packages in JAX-RPC web service

    I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
    package supercomputer;
    import Hello.*;
    public class SuperImpl implements SuperIF
    public String sendParam(String data)
    Temp ob=new Temp();
    int i=ob.get1(10000);
    return data+"returned by supercomputer";
    Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
    The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
    [echo] Running the supercomputer.SuperClient program....
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    [java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
    [java] at supercomputer.SuperClient.main(Unknown Source)
    I dont know if it deploys why it gives error on client side.
    Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
    Please guide me in doing that.
    Thanks,
    Farrukh

    Farrukh,
    I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
    To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
    As I already said, I have doubts that your error should be originated from a missing class from your package, but:
    -try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
    -try to see if you can access your endpoint through your browser to see if there is a online status
    -display your config/WSDL file, and the steps you did to build your web service.
    regards,
    Pedro Salazar.

  • How can I call a stateful webservice from a user-defined XPath function?

    I'm calling a stateful webservice from a BPEL process using a PartnerLink which implements Custom Header Handler classes to handle the session state, storing the cookie as a property of the PartnerLink.
    I'd also like to call this same stateful webservice, in the same session, from a user-defined XPath function enabling me to call this from an XSL Transformation.
    Is this in any way possible? Can I access the cookie and attach it to the webservice call made by the user-defined XPath function?

    Actually, as long as the servlet returns valid javascript, you can indeed "call it" from the client. It will initiate a request and return the result to the browser.
    This example uses Perl, but it could be easily modified to go to a servlet instead.
    Note that it is only supported in DOM browsers (IE6+/NN6+/etc)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html>
    <head>
    <title> Test server-side JS </title>
    </head>
    <body>
    <script type="text/javascript">
    function checkIt(variable, value)
    var newScript = "cgi-bin/validateJS.cgi?"+variable+"="+value;
    var body = document.getElementsByTagName('body').item(0)
    var scriptTag = document.getElementById('loadScript');
    if(scriptTag) body.removeChild(scriptTag);
    script = document.createElement('script');
    script.src = newScript;
         script.type = 'text/javascript';
         script.id = 'loadScript';
         body.appendChild(script)
    </script>
    <p>Test.</p>
    <form id="f1" action="">
    <input type="text" name="t1" id="t1" onChange="checkIt(this.name, this.value)">
    </body>
    </html>
    validateJS.cgi
    #!/opt/x11r6/bin/perl
    use CGI qw(:all);
    my @valArray = split(/=/,$ENV{QUERY_STRING});
    print "Content-type: text/javascript\n\n";
    # myPass is the password
    $myPass = "foobar";
    if ("$valArray[1]" eq "$myPass")
    print "alert(\"Success!!\")";
    else
    print "alert(\"Failure!!\")";

  • I log in under different user and can not use our pictures on iPhoto, how can i use them under different user?

    After creating and signing in under a different user on imac, how can i use iphoto pictures?

    If you want to access the same library from different user accounts on your Mac put the library on an external hard drive connected to the iMac and make sure it's formatted OS X Extended (journaled) with ownership set to be ignored.
    OT

  • I had to do a complete system restore on my computer and now I am having issues getting all my music back. It's telling me that my account is in use with a different user but I'm the only user on my computer. When I go to sync it, it wants to delete all.

    I had to do a complete system restore on my computer and now I am having issues getting all my music back. It's telling me that my account is in use with a different user but I'm the only user on my computer. When I go to sync it, it wants to delete all my music and ringtones. What should I do? I don't want to loose all my items.

    When in recovery mode you can't backup the iPod.
    You will have to restore via iTunes. See:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Copying a query from different user group

    masters,
    is it possible to copy a query from different user group?
    if so please tell me how
    thnks!

    The query made from SQVI is only intended for individual use. It cannot be transported and there is no concept of Global/Standard area. To be able to transport or share the query to other users is by converting it to SAP Query wherein the source of data will also be converted to an Infoset. Remember that is done in the Standard query area. To do this, go to SQVI-> click SAP Query then go to menu Query -> Convert Quickviews... Select your Quickview queries and provide and infoset name.

  • [POL-3309] trying to use datapage from different file.

    Getting this error trying to access both the ESB and BPEL datasources in SOA Suite 10.1.3 GA.
    Any ideas how to fix?

    I am also getting same error message when I am trying to establish a olite connection. Moreover I got this error when I opened BPEL console :
    Cannot fetch a datasource connection.
    The process domain was unable to establish a connection with the datasource with the connection URL "jdbc/BPELServerDataSourceWorkflow". The exception reported is: [POL-3309] trying to use datapage from different file
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid.
    Please provide solution.....

  • How to backup files from other user logged in as administrator

    RE: How to backup files from other user logged in as administrator AND/OR how to repair drive with "Invalid catalog PEOF"
    Hello,
    My MacBook Pro computer’s hard drive is not booting.
    I booted with the base operating system and ran Disk utilities and I got the following messages:
        Invalid catalog PEOF
        The volume could not be verified completely.
        This disk needs to be repaired.
        Disk utility can’t repair this disk. Backup as many files as possible, reformat the disk,
        and restore your backed-up files.
    The problem is that I have a couple of USERS set up on this computer, and it won’t let me backup the files of the second user.  The folders are locked and I can’t access them, even though I am logged in as the administrator.
    I made a boot disk on my other computer ( a MacPro Early 2008 ) desktop computer with the DiskWarrior 4.4 updater,
    but it won’t boot on my MacBook Pro.
    How can I backup these user files so that I can copy them back once I fix the drive?
    or better yet,  How can I repair the Invalid catalog PEOF on this drive?
    Thank you in advance for your time! 
    Bill
    THIS IS THE COMPUTER
    ================
    17” MacBook Pro 2.8GHZ 4GB Ram (purchased in 2009).
    Model: A1297
    Running Mac OSX 10.9.5

    Try using Disk Utility/Restore to copy the backup to a new location. Please note that this will reformat the destination partition which will erase all data.
    Do a backup. Boot to the Recovery Volume (command - R on a restart or hold down the option/alt key during a restart and select Recovery Volume). Run Disk Utility Verify/Repair and Repair Permissions until you get no errors.  Reformat the drive using Disk Utility/Erase Mac OS Extended (Journaled), then click the Option button and select GUID. Then re-install the OS.
    OS X Recovery
    OS X Recovery (2)
    When you reboot, use Setup Assistant to restore your data.

Maybe you are looking for