Create command

The Cashier class is responsible for processessing commands input by the user. There
should be a single field, used to hold all the accounts that the cashier has created, which
has the datatype HashMap. Remember that each entry added to a HashMap requires a key
and a value. In this case, the key will be a String value which is the email address of the
account. The value will be the Account object itself.
You need to write a single constructor for Cashier which initialises the field to an empty
HashMap
import java.util.HashMap;
public class Cashier
    HashMap<String, Accounts> userAccounts;
    Cashier()
        userAccounts = new HashMap<String, Accounts>();
}I have created the single constructor for the HashMap, but I'm totally lost on the next step, any help will be appreciated:
The next step is to make a command called create.
The create command creates a new account. The cashier must ask for an email
address and a password before constructing a new Account object and adding it
to the HashMap of accounts. The cashier responds with ?Your account has been
created?. If an account using the given email address already exists, the cashier
responds with ?The account already exists?.

Read about maps:
http://java.sun.com/docs/books/tutorial/collections/index.html
Especially:
http://java.sun.com/docs/books/tutorial/collections/interfaces/map.html
http://java.sun.com/docs/books/tutorial/collections/implementations/map.html

Similar Messages

  • Creating command line for creating a FR pdf file

    I need to create a command line that takes a FR generate a PDF file and saves it in a specific folder.
    The question is, is it possible to create command lines in HFM and does some have an example ?
    Thank's

    Hello,
    To generate an hyperlink in a HTML or PDF output , use the property hyperlink
    http://docs.oracle.com/cd/B14099_17/bi.1012/b13895/orbr_howto.htm#i1058897
    Regards

  • How to create command line java client

    I have a java servlet FileClient.java and am invoking it thru POST method from the html file. How can I create command line java client so that I can execute this class file from windows command prompt.
    e.g. java FileClient <argument>
    TIA

    > .. there's also a "won't work".
    I could post a sample...I know that you can instantiate and call aservlet,
    or even write your own servlet container - butit's
    still a local instance. He can't invoke his remote
    servlet by calling its class on the client like he
    suggested.HttpURLConnection in main.Only if his Servlet has a main method. Which wouldn't really make it a servlet anymore.
    OP said he wants to invoke it from command-line using
    java -cp . TheServletClass
    He said he has a servlet called FileClient. And he can't invoke a servlet directly that way, without building a wrapper that starts it, making it more than a servlet, and it definitely won't execute on the server. That's my whole point. I never wanted to say you can't write a command-line program that invokes a servlet on a remote server. I do it myself after all.
    I guess I should have expressed myself more clearly.

  • To create such script which will fetch all this data in form of create command

    Whenever I do a restore I always forget to reapply some database roles or application roles in post restore steps.We have one database of very different db roles,Grant permissions,Login and User permissions and they changes also frequently.
    What dmv's I required to create  such script which will fetch all this data in form of create command and after restore I just have to run those create commands and all the rights should visible as before .
    Thanks

    The context of your question is not entirely clear, but I assume that you restore a copy from one type of environment (for instance QA) to another (for instance development).
    To get group membership, you use the catalog views sys.database_principals and sys.database_role_members. Querying these is straightforward.
    To get permissions you would query sys.database_permissions. This view is more difficult to query, but you can take shortcuts depending on what is in use at your site.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Aggregate table - Create command

    Hi all,
    I have to create aggregate tables. For that I use aggregate persistance wizard and created two files (.sql & .dll ).
    When i run the .sql file using nqcmd.exe -u XXXX -p YYYY -d ZZZZ -s D:\GL_AGGR.SQL
    Its throws an errror as Invalid create command
    How to solve this ?
    Thanks,
    Haree

    Hi,
    See the syntax:
    D:\Oracle\Middleware\Oracle_BI1\bifoundation\server\bin>nqcmd.exe -u <DB userid> -p <DB Password>
    -d <DSN NAME> -s <SQL script path>
    D:\Oracle\Middleware\Oracle_BI1\bifoundation\server\bin>nqcmd.exe -u userA -p
    <Password> -d sampe -s D:\test.sql
    Example execution steps:
    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.
    C:\Users\Deva>d:
    D:\>cd D:\Oracle\Middleware\Oracle_BI1\bifoundation\server\bin
    D:\Oracle\Middleware\Oracle_BI1\bifoundation\server\bin>nqcmd.exe -u userA -p
    Password1 -d sampe -s D:\test.sql
    Oracle BI ODBC Client
    Copyright (c) 1997-2011 Oracle Corporation, All rights reserved
    rocessed: 1 queries
    D:\Oracle\Middleware\Oracle_BI1\bifoundation\server\bin>
    Thanks
    Deva

  • How to create command file for the Database Project?

    Hi All,
    We are using Oracle 10G.
    We are using Database Project in Visual Studio.NET to source control the SQL Scripts of SPs and Tables.
    Now, while creating commad file, it asks me select all the files to be included. thats fine. But after creation, if I open and see...It starts like....
    osql...test1.sql.
    osql...test2.sql
    but, osql is commad of SQL Server not of Oracle...if am not wrong..!
    Is there any settings that can help me create command file that works on Oracle?
    Thanks and Regards
    Senthil

    File>Print
    Choose Adobe PDF as your printer
    Go to Setup
    Go to preferences
    Choose the standard
    Make sure the rest of your settings are correct for the page size etc.
    It's a big screenshot so I've linked instead of posting here.
    Sorry had to blur out some PDF settings for privacy reasons
    http://img339.imageshack.us/img339/6103/37345539.png

  • Finding out the 'create' command that i gave to make a table?

    any way to find out what the 'create' command that i gave to make a table.
    i have already given the create and its created a table but is there any way of knowing what the syntax was.? after giving it?

    It's not as easy to come up with the actual (entire) command that created the table. You might be able to use
    the DESC table_name to see the structure. However, if you need to know if any fields have constraints, default values,
    what the keys are, etc.. You would have to come up with a script to create the CREATE TABLE script
    The system tables to look at are:
    USER_TABLES
    USER_TAB_COLUMNS
    USER_CONSTRAINTS
    USER_CONS_COLUMNS
    USER_INDEXES
    USER_IND_COLUMNS
    any way to find out what the 'create' command that i gave to make a table.
    i have already given the create and its created a table but is there any way of knowing what the syntax was.? after giving it?

  • Failed to create commande process

    Hi,
    in 10G R2 on Win 2003 server,
    I created a (host) job in DB Control (OEM) it should do the following on the host :
    dir d:But it fails with :
    Error : Failed to create commande processI found the following and verified it was already done:
    If you are running your 10g database on Windoz system then
    Go to start->Administrative tools->Local security policy
    and under security settings->Local Policies->User Rights Assignment
    double click on Log on as a batch job
    in there add the os user to that group
    This then should fix the error, its a 10g bugand despite of that , my job does not run.
    Any idea ?
    Thank you.

    Manually creating and submitting job may help you. See thread Re: RMAN in scheduler
    Regards

  • Create Command using jsp

    Hi all
    I want to create custom commands and i have achieved to create one by extending AbstractCommand.
    The thing is that the user interface is built creating the htmlb components from java code. I want to use a jsp for this. ¿How can I redirect to a jsp from the AbstractCommand class?
    Does anyone know any documentation that can help me to do this?
    Thanks in advance.

    Hi Marcos,
    I have no documentation, but you can just launch a portal application by javascript. This application, of course, can be a JSPDynPage. Voila - your JSP Command!
    See: <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=127822">FlexUI Command calls AbstractPortalComponent</a>
    HTH,
    Carsten

  • Creating Commands in Fireworks

    I would like to create a command to automatically resize the
    canvas of images by 10 pixels (height & width). Can someone
    explain how to do this? I am using CS3.

    Save the following code as "Resize by 10.jsf" into your
    Fireworks Commands Configuration folder (C:\Program
    Files\Adobe\Adobe Fireworks CS3\Configuration\Commands\ on WinXP).
    You can then use it by going to the Commands > Resize by
    10 menu.
    This will shrink an image by 10px on the right and bottom.
    HTH

  • How create command-line a new OC4J instance?

    I have no access to OAS console and I need to create it with command-line.
    Do you know sintaxis?
    Thanks in advance.
    Message was edited by:
    JohnRC

    depends on version

  • CREATE command and AUDIT

    Hi All,
    my Oracle RAC 11g, is configured with audit:
    audit_sys_operations = false
    audit_trail = DB
    I use one oracle user for check auditing, The user is audit_reader, and it has grant select on sys.aud$ and grant select on sys.v$instance
    If I log in oracle by / as sysdba and run create user command, audit_reader user can not see ths execution.
    How I can set audit and audit_reader user for see any DDL command?
    Thanks
    Giovanni

    If AUDIT_SYS_OPERATIONS is FALSE, then connections as SYSDBA will not be audited.
    If you want to audit what SYS does, you'll need to set the AUDIT_SYS_OPERATIONS parameter to TRUE. But SYS operations won't be written to SYS.AUD$ for security reasons. Since SYS can delete rows from the AUD$ table, the SYS audit trail has to be written to the file system (where, presumably, you can configure file permissions so that the DBA cannot modify the audit trail).
    Justin

  • How to create command button called 'Remarks' and Check box in ALV GRID?

    Hi, Experts,
    Requirement is: in the ALVE GRID report output, user select a record by clicking the check box and pressing the button 'Remarks' it will take me into other transaction from the output list.
    Please help me out.
    Reward points.
    Sekhar

    Hi Chandra Shekar,
    Check the following sample program. 2 things to remember.
    1. Check the callback subroutine PF_STATUS_SET and create PF status for the program.and also ur REMARKS button in the application tool. Comments are made every where wherever those are needed. After creating Pf status execute the report.
    2.Once you select records by selecting checkboxes, u have to press on Refresh button( that is there on application toolbar), then only for selected records, CHECK field in the internal is updated. After that press on REMARKS button .
      REPORT zvenkat_alv_grid.
      TABLES:t001.
      "Types
      TYPES:
            BEGIN OF t_1001,
              check TYPE c,
              bukrs TYPE t001-bukrs,
              butxt TYPE t001-butxt,
              ort01 TYPE t001-ort01,
              land1 TYPE t001-land1,
            END OF t_1001.
      "Work area
      DATA:
            w_t001 TYPE t_1001.
      "Internal table
      DATA:
            i_t001 TYPE STANDARD TABLE OF t_1001.
      " ALV Declarations
    * Types Pools
      TYPE-POOLS:
         slis.
    * Types
      TYPES:
         t_fieldcat         TYPE slis_fieldcat_alv,
         t_events           TYPE slis_alv_event,
         t_layout           TYPE slis_layout_alv.
    * Workareas
      DATA:
         w_fieldcat         TYPE t_fieldcat,
         w_events           TYPE t_events,
         w_layout           TYPE t_layout.
    * Internal Tables
      DATA:
         i_fieldcat         TYPE STANDARD TABLE OF t_fieldcat,
         i_events           TYPE STANDARD TABLE OF t_events.
    *&    start of selection
      START-OF-SELECTION.
        PERFORM get_data.
    *&    end-of-selection.
      END-OF-SELECTION.
        PERFORM build_fieldcatlog.
        PERFORM build_events.
        PERFORM build_layout.
        PERFORM list_display.
    *&      Form  get_data
      FORM get_data .
        SELECT bukrs
               butxt
               ort01
               land1
          FROM t001
          INTO CORRESPONDING FIELDS OF TABLE i_t001
          UP TO 30 ROWS.
      ENDFORM.                    " get_data
    *&      Form  build_fieldcatlog
      FORM build_fieldcatlog .
        CLEAR:w_fieldcat,i_fieldcat[].
        PERFORM build_fcatalog USING:
                 'CHECK' 'I_T001' ' ',
                 'BUKRS' 'I_T001' 'BUKRS',
                 'BUTXT' 'I_T001' 'BUTXT',
                 'ORT01' 'I_T001' 'ORT01',
                 'LAND1' 'I_T001' 'LAND1'.
      ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  BUILD_FCATALOG
      FORM build_fcatalog USING l_field l_tab l_text.
        w_fieldcat-fieldname      = l_field.
        w_fieldcat-tabname        = l_tab.
        w_fieldcat-seltext_m      = l_text.
        IF  l_field = 'CHECK'..
          w_fieldcat-checkbox = 'X'.
          w_fieldcat-edit     = 'X'.
        ENDIF.
        APPEND w_fieldcat TO i_fieldcat.
        CLEAR w_fieldcat.
      ENDFORM.                    " build_fieldcatlog
    *&      Form  build_events
    *       text
      FORM build_events.
        CLEAR :
              w_events, i_events[].
        w_events-name = 'TOP_OF_PAGE'."Event Name
        w_events-form = 'TOP_OF_PAGE'."Callback event subroutine
        APPEND w_events TO i_events.
        CLEAR  w_events.
        w_events-name = 'USER_COMMAND' .
        w_events-form = 'USER_COMMAND' .
        APPEND w_events TO i_events.
        CLEAR w_events.
        w_events-name = 'PF_STATUS_SET' .
        w_events-form = 'PF_STATUS_SET' .
        APPEND w_events TO i_events.
        CLEAR w_events.
      ENDFORM.                    "build_events
    *&      Form  build_layout
      FORM build_layout .
        w_layout-colwidth_optimize = 'X'.
        w_layout-zebra             = 'X'.
      ENDFORM.                    " build_layout
    *&      Form  list_display
      FORM list_display .
        DATA:
              l_program TYPE sy-repid.
        l_program = sy-repid.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = l_program
            is_layout          = w_layout
            it_fieldcat        = i_fieldcat
            it_events          = i_events
          TABLES
            t_outtab           = i_t001
          EXCEPTIONS
            program_error      = 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.
      ENDFORM.                    " list_display
    *&      Form  top_of_page
      FORM top_of_page.
        DATA :
         li_header TYPE slis_t_listheader,
         w_header  LIKE LINE OF li_header.
        DATA:
              l_date TYPE char10.
        WRITE sy-datum TO l_date.
        w_header-typ  = 'H'.
        CONCATENATE sy-repid ':' 'From Date' l_date INTO w_header-info SEPARATED BY space.
        APPEND w_header TO li_header.
        CLEAR w_header.
        w_header-typ  = 'S'.
        w_header-info = sy-title.
        APPEND w_header TO li_header.
        CLEAR w_header.
        w_header-typ  = 'A'.
        w_header-info = sy-uname.
        APPEND w_header TO li_header.
        CLEAR w_header.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            it_list_commentary = li_header.
      ENDFORM.                    "top_of_page
    *&      Form  pf_status_set
      FORM pf_status_set    USING extab TYPE slis_t_extab.
        "Procedure to set own pf-status.
        "1.Goto Transaction code SE41
        "2.give program = SAPLKKBL and status = STANDARD_FULLSCREEN.
        "3.Click on Application toolbar STATUS button
        "4.Give ur program name Status name that is to be used in the program using SET pf-status statement
        "5.Create ur button REMARKS.
        SET PF-STATUS 'STATUS1' EXCLUDING extab.
      ENDFORM.                    "pf_status_set
    *&      Form  user_command
      FORM user_command USING ucomm LIKE sy-ucomm
                        selfield TYPE slis_selfield.
        CASE ucomm .
          WHEN 'REMARKS'."When u click on remarks button.
            LOOP AT i_t001 INTO w_t001 WHERE check = 'X'.
              WRITE :/ w_t001-bukrs, 'Checked'.
            ENDLOOP.
        ENDCASE.
      ENDFORM.                    "user_command
    I hope that it helps u .
    Regards,
    Venkat.O

  • How to show dynamically created popup from created command button?

    In my region I have a toolbar. The buttons in the toolbar are created dynamically in the bean. When one of the buttons is clicked I’d like to display a popup dialog.
    So, the code looks something like this:
    RichCommandToolbarButton button = new RichCommandToolbarButton();
    // set icons, text, etc….
    RichPopup popup = new RichPopup();
    // set id etc.
    RichDialog dialog = new RichDialog();
    dialog.setType(“cancel”);
    // add title, text, another button to toolbar, etc.
    popup.getChildren().add ( dialog);
    ClientListenerSet set = button.getClientListeners();
    if (set == null)
    set = new ClientListenerSet();
    button.setClientListeners(set);
    set.addFeatureDependency("AdfShowPopupBehavior");
    set.addBehavior("new AdfShowPopupBehavior('" + popup.getId() + "', AdfRichPopup.ALIGN_AFTER_END,null,'action')");
    button.setPopup(popup);
    In the corresponding .jsff the toolbar and the buttons are rendered in the following way:
    <af:toolbar id="t1" styleClass="AFStretchWidth"
    visible="#{backingBeanScope.MyBean.visible}" >
    <af:forEach items="#{backingBeanScope.MyBean.buttons}" var="adfButton" >
    <af:commandToolbarButton binding="#{adfButton}" />
    </af:forEach>
    This kind of works, except the button shows up with the down-arrow menu icon, which when clicked shows a tiny empty rectangle/menu. When the button itself is clicked, it correctly shows the popup with the dialog.
    So… how do I do this w/o doing the button.setPopup() so that I do not get the empty menu, but just get the popup to show when the button is clicked? Or is there a way to disable showing of the (empty) menu?
    I have tried adding the popup to the toolbar, but that did not work.
    I have tried adding action listener to the button, and adding the popup to the toolbar there and then showing it (by doing new RichPopup.PopupHints(); popup.show(ph)), but that did not work.
    I have tried adding action listener to the button, and adding the popup to the button getChildren().add() then showing it ((by doing new RichPopup.PopupHints(); popup.show(ph)), but that did not work.
    ANY help will be most appreciated!

    Hi,
    Do u mean to say that u need to open another PLD in when ur user form is open.?
    Please provide more information.
    Thanks,
    Vasu Natari.

  • Database Diff - Generates Create commands only (does not list alter command

    Hi I'm using very latest version of the SQL developer. I was using Database Diff feature and found issue that when there is differences in table (say a addition column exits in one of the database), generate script generates "Create table..."statement. I would rather expect alter table because table exist on both databases but a column was different.
    If I take that script try to create table on the database that has difference, then I would have to lose all data (of course there are alternatives), which is not very efficient script then.
    any ideas if there is an option to show alter commnads?
    thanks.

    The usage of the Diff wizard is not crystal clear.
    If your connections are as user X, but the objects are owned by user Y, they won't be picked up in the target connection. Although you are allowed to pick objects from different users (user Y) on the source side, the comparison seems to be with user X on the target side. For it to work properly, you need to define connections ob both sides as user Y. I haven't really tested this thoroughly because I don't have the change management pack licensed anywhere.

Maybe you are looking for

  • Re: [iPlanet-JATO] using begin childName Display method

    Oops. Sorry about that, Craig. I didn't realize I might leave that impression. I'm sure the tiled views work since you have so many examples of these and it's a relatively simple concept, isn't it? Not to mention a necessary one. I didn't have time t

  • How do I copy 1 external HD to another?

    I was just at the Genius bar who reformatted my new WD 1 TB drive for use w Time Machine. He also showed me how to copy my old Seagate HD (that is getting noisy so want to back it up) to the new WD drive. W both HDs plugged into the USB ports of the

  • Not enough memory on adobe acrobat 9 for web page capture

    I use adobe acrobat 9 pro for creating a pdf with web page capture function. After a while (about more of 500 pages) the free ram became insufisant and the program stop. I am running on windows 7 with 4 Go ram. When i take a look on memory utilisatio

  • Moving still images in dropzones

    I just updated to ilife '08 and am a little concerned because in my original idvd i could move photos around when they were in a dropzone or as a backdrop. It seems you cannot do this with 08? Can anyone help because i really need to use this option

  • Installing Flash Player plz help

    Im on a macbook pro and when i try to install flash player it says i need to type in my password but its not my normal password so i can't  type it to do the update i think its called a admins password but i do not know the admins password? plz help