Saving user input for later use ! How ?

Hi ! I wrote a simple program called GPA Calculator. In the program, the user chooses the lessons he takes and he enters his grades on those lessons and the computer calculates his GPA. It was a simple task to do thanks to swing class.
But the problem is , since the user always choose the same lessons, I want to add a user control interface by which , a user can save his information by pushing a button which will be called "save"and when he runs the program again and after logginning by his username , his lessons are shown automatically by the program.
I know a bit C++. And the only solution that popped into my mind is saving the data in a text file.And after he logins again , checking if there is such a user in the saved text file. In C++ there was a file processing method called random access files and i am planning to use it exists in java (i am gonna look for it).
Since i am new to java and programming, I want to ask you naively if you advise me any other methods.
Thanks for your help iin advance.
(I hope now it is the right place to put this message :)

i am trying to use a database system (and learning it)
i downloaded derby. but everytime i am trying to run the program , i encounter this error. i am trying to use derby in embedded mode .
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:169)
     at SimpleApp.go(SimpleApp.java:64)
     at SimpleApp.main(SimpleApp.java:48)
i tried to solve the problem but i couldnt.can you pleease tell me what to do step by step ?
thanks for your help ....

Similar Messages

  • How to force sql developer to prompt for user input for every execution ?

    Hi Folks,
    Environment: Oracle 11g (on Windows 7)
    SQL Developer: *3.1.07*
    I am executing a PL/SQL code off Sql Developer. The code uses substitution variables to prompt user for input. However,I am only prompted for the user input for the very first run of the code. For the subsequent executions, the code simply picks up the user input from the very first run. This behavior persists for all subsequent runs of the code.
    I have executed the same piece of code from SQL*PLUS and the behavior seems normal (i.e. I am prompted for fresh input for every execution)
    How can flush out the old user input so I can be prompted for new user input for every run of the code in sql developer?
    Thanks in advance
    rogers42

    Hi Rogers42,
    1/try
    undefine
    undefine fred
    select '&&fred' from dual;
    [run this multiple times]
    [prompts gere]
    old:select '&&fred' from dual
    new:select 'a' from dual
    'A'
    a
    [prompts here]
    old:select '&&fred' from dual
    new:select 'b' from dual
    'B'
    b
    2/try
    exit (requires recent version of sql developer: tools->preferences->Database->worksheet->Re-initialize on script exit command)
    select '&&fred' from dual;
    exit
    run this multiple times
    [prompts here]
    old:select '&&fred' from dual
    new:select 'x' from dual
    'X'
    x
    Commit
    [prompts here]
    old:select '&&fred' from dual
    new:select 'y' from dual
    'Y'
    y
    Commit
    3/use &fred instead of &&fred
    For background see
    http://totierne.blogspot.co.uk/2010/04/substitution-and-bind-variables.html
    -Turloch
    SQLDeveloper team

  • XML parsing (KXml) - how to save parser's position for later use?

    Hello.
    I am parsing an xml file using KXmlParser and i want to keep the position of the parser for later use so i can continue from that same position.
    int eventType = parser.getEventType();
            if (coupletForm!=null) {
                coupletForm.deleteAll();
            while (eventType != KXmlParser.END_DOCUMENT) {
                if (eventType == KXmlParser.START_TAG ){
                    String element_name = parser.getName();
                    if (element_name.equals("couplet")) {
                        coupletForm = new Form("Couplet 1");
                    else if (element_name.equals("lead_one")) {
                        while (eventType != KXmlParser.TEXT || (eventType == KXmlParser.TEXT && parser.isWhitespace()) ){
                            eventType = parser.next();
                        //Now reached <description> element
                        coupletOptions = null;
                        coupletOptions = new ChoiceGroup("Choose lead:", Choice.EXCLUSIVE);
                        coupletOptions.append(parser.getText(), null);
                        parser_stack.push(parser);
                    else if (element_name.equals("lead_two")) {
                        while (eventType != KXmlParser.TEXT || (eventType == KXmlParser.TEXT && parser.isWhitespace()) ){
                            eventType = parser.next();
                       //Now reached <description> element
                        coupletOptions.append(parser.getText(), null);                  
                        coupletForm.append(coupletOptions);                  
                        parser_stack.push(parser);
                        coupletForm.addCommand(CMD_NEXT);
                        coupletForm.setCommandListener(this);
                        display.setCurrent(coupletForm);
                        break;
                eventType = parser.next();
        }What i am doing here is parsing the xml file. When the parser finds an element with name <lead_one> it continues parsing until it finds the next element (<description>) and then creates a ChoiceGroup with the first option as the text found in the next element. I want to keep this position of the parser. The parser then continues until it finds element <lead_two> and does the same thing as <lead_one>. I want to save the positions of the parser when it stops at the <description> element. I am trying to do this using a stack, but this doesn't work.

    If you want to select nodes based on changing criteria, you should use XPath.
    If you have relatively fixed criteria, iterate over the nodes and pick out the ones that you want. For example:
      public static List<Element> getChildren(Element parent, String tagname) {
        List<Element> result = new ArrayList<Element>();
        NodeList children = parent.getChildNodes();
        for (int ii = 0 ; ii < children.getLength() ; ii++) {
          Node child = children.item(ii);
          if ((child.getNodeType() == Node.ELEMENT_NODE) && tagname.equals(child.getNodeName()) {
            result.add((Element)child);
        return result;
      }

  • Best method for timestamping? (for later use with perl script)

    What is the best method that I can use to timestamp events in Linux for later use with perl script?
    I am performing some energy measurements.. where I am running several tasks separated by 20 secs in between. Before I start any execution of tasks, I always place initial delay for me to start the script and start the measurement device.
    My problem is that I don't know how long is that first delay exactly. So to solve this, I thought I could use date commands to time stamp all tasks.. or at least to timestamp first dela.
    Here is example of what I am doing:
    1st delay
    task 1
    20s
    task 2
    20s
    task 3..... etc
    What would be the best to use?

    logger.
    It posts messages straight to the system log.  You can see the message, in all its glory using tools like journalctl.  You will see the message, the date, time, host name, user name, and the PID of logger when it ran.

  • Require User Input for either dashboard prompts not BOTH ! !

    Fellow Earthlings,
    How to make required for user input for either of dashboard prompts not BOTH. !!!!!!
    Like if they enter '123' on DashP1 they need not have to enter DashP2 value and vice versa on same dashboard prompt.
    I have some dashboard prompts and I am using presentation variables to pass these values to my analysis.
    DashP1 - Pvar1 - Default All columns - User can type in values
    DashP2 - Pvar2 - Default All columns - User can type in values
    In my report , I am using a SQL filter to do a table.column_name LIKE (concat('@Pvar1}{'%')) same for the other table.column_name LIKE (concat('@Pvar2}{'%')) [ This is because users want to do a partial match on the value.
    So when the user is typing the values like 123 on DashP1 they are able to search, which is good. However on DashP2 which defaulted to all column values, they just erase/delete that and pass no value to it. So it remains the prompt vlaue is looking like -Select Value state which is not good. :(
    Now when there report is run for that DashP1 -value as '123' obviously we get no results since erasing that is causing it not to pass any value and when i check the query log it passes '@Pvar2'. This is causing no results.
    So I thought making it Required user input would resolve the issue, however the new request is to have either DashP1 or DashP2 require user input.
    Please advice if there a way to solve this problem.
    If this any way possible with Action links or any other methods.
    Any help is greatly appreciated.
    Thanks,
    VidyaS

    Hi Vidya, Please post that Script it will be quite handy for other OTN users.
    Thanks
    NK

  • Where are mobile Illustrator draw files stored for later use in Desktop Illustrator?

    Hello,
    who can tell me, where Mobile Illustrator draw vector files are stored for later use in Desktop Illustrator? In the cloud there are only .png and .jpg files. The Files are sent immediately to the desktop software, but when I want to use them later, I cannot find them anymore.

    What exactly are your steps?
    Create new file in Draw
    Draw something
    Send to Illustrator
    ... and then? Does Illustrator open on the desktop? What do you do with the Draw file?

  • Is it possible to save a Photoshop project with multiple tabs (inducing images) for later use. Now, when I close Photoshop, it ask to save each tab separately and they are not staying in the project for later usage. Thanks in advance for you help.

    Is it possible to save a Photoshop project with multiple tabs (inducing images) for later use. Now, when I close Photoshop, it ask to save each tab separately and they are not staying in the project for later usage. Thanks in advance for you help.

    You should ask in Photoshop General Discussion
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • How to capture user input for customer exit processing?

    I need to calculate the number of working days elapsed in the current fiscal quarter BASED on the USER INPUT on the reporting front.  i.e., say the fiscal quarter started on 1 July 2005 and if the user enters 10 July 2005, I should get the value 8 (Assume that Monday through Friday are all workdays).  If the user enters 12 July 2005, I should get 10.  I have written customer exits and know how to use factory calendar, but <b>THE CHALLENGE</b> is how do I <b>CAPTURE</b> the user input and use it in my exit?  During the varible definition, if I select the check box "Ready for input" then the customer exit is not being processed and unless I check that box I can't get a user entry!  If I look at the import values in the customer exit, I see i_t_var_range with type rrs0_t_var_range.  My strong feeling is that this parameter gets the user input, but I am unable to use it as the customer exit is not being called if I make the user to input the data.  Based on the empirical evidence, I felt that user input and customer exit can not co-exist!!  Please somebody prove me wrong and let me know how can I use the user input to process my "customer-exit" variable.  I would really appreciate any input from the BW community here.

    Hi Sameer,
    Most likely, I'm missing something, but I think that the answer is very simple.
    CASE I_VNAM.
    WHEN 'YOUR_CUSTOMER_EXIT_VAR'.
    IF I_STEP = 2. “ After selecting of input variable
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'USER_INPUT_VAR'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    In this typical user exit coding you have a user entered value in LOC_VAR_RANGE (originally in I_T_VAR_RANGE) and you construct your user exit variable value in E_T_RANGE.
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • How to save User input into DB using webdynpro abap

    Hi,
    Im trying to create an application using webdynpro abap.
    I want to know how to save the data input by user, into a database table.
    In my UI, I have a table control which is editable and user inputs data into this. I need to know how i can transfer this data to a DB table.

    hello,
    u can do it by reading ur context node.
    we bind our UI elements to context attributes of appropriate type .
    we read their values using the code wizard or by pressing control+F7, click on radio button read node/attribute
    here for ur specific case , u must have binded ur table control with the context attribute , now u need to simply read this attribute
    eg suppose u have created a context node " cn_table"
      reading context node cn_table
       DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
             lo_el_cn_table TYPE REF TO if_wd_context_element ,
             ls_cn_table    TYPE wd_this->element_cn_table.
    *   navigate from <CONTEXT> to <CN_TABLE> via lead selection
      lo_nd_cn_table = wd_context->get_child_node(
                       name = wd_this->wdctx_cn_table ).
    **    get element via lead selection
      lo_el_cn_table = lo_nd_cn_table->get_lead_selection(  ).
      lo_el_cn_table->get_static_attributes( IMPORTING
                 static_attributes = wa_table ).
    here wa_table is the work area of structure type . u need to create a structure first with the same variables as there are the context attributes in ur node cn_table
    in ur
    now ur wa_tablecontains value
    u can nw use appropriate FM to update , delete and modify the DB table using the value
    u cn directly use SQL statements as well in the method of ur view , but direct SQL statements are nt recommende
    rgds,
    amit

  • If i have "saved my tabs for later", how do i recover them during a later session?

    with several tabs open, i chose "save tabs for later". i then quit firefox, and did not "restore the previous session" when i opened it next. i have now opened firefox again, and would like to restore the tabs that i had previously saved. how do i do that?
    i am using firefox 6.0.1 on a mac with os 10.6.8.
    thanks.

    I guess when you update to 6.0.1 it defaults to "clear browser history" every time you exit. So if you have it set to save your session it will give you the option when you quit, but end up clearing your history, so it won't be able to restore it.
    1. First go to Tools>Options
    2. Privacy>History
    Here there will be History options, Select "Use custom settings for history"
    3. Make sure "clear history when Firefox closes" is UNChecked
    I am using Windows, so the commands may be different.
    Reference:
    http://www.pinoyquickguides.com/firefox-6-0-1-doesnt-show-tabs-from-last-time-how-to-restore-tabs/

  • How to validate a user input for where clause?

    I have a situation to validate a where clause which is input by the user.
    Because the query will be run against huge tables and we need to notify the user if they input the clause is not valid.
    I use the below query to try:
    Select 'A' from blablabla where user_input_where_clause and 1=0;
    however, it can not capture the error when the user input:
    'name=123' while the right condition should be name='123'.
    Can you pls advise ?

    In this particular case, Oracle will not even try to run the SQL statement because of the syntax error. IF the WHERE condition supplied does not make sense, Oracle will not execute the statement, so it does not matter if the query accesses huge tables.
    SQL> Select 'A' from blablabla where 'name=123' and 1=0 ;
    Select 'A' from blablabla where 'name=123' and 1=0
    ERROR at line 1:
    ORA-00920: invalid relational operator
    SQL>IF you have a restriction as to what type/value can user specify for the where condition (asuming it would make sense to SQL engine), you would have to do it before submitting to the database.
    Note, however, that user could specify any condition they like, having potentially damaging effects.

  • How can I stop firefox from auto saving user ids for various websites? I do not want them to be remembered for security reseasons

    I do not wish to start typing my user id for a website and it automatically coming up as a choice since it has been remembered from a previous attempt. How can I delete firefox from remembering it so I just always type it myself?

    The [[Form autocomplete]] article has information on deleting saved entries and preventing the browser from remembering form entries in the future.

  • How to continuous​ly do AOAI and buffer the data for later use?

    Is there a way to do simultaneous AI and AO and keep the data in the buffer until I am finished with reading, then read the buffer and save the data to disc. I want to acquire 1000 scans on up to 10 chanels at 10 000 Scans/s, while generating one output signal.
    I have seen plenty of continuous AIAO examples, but all they do is show the data. I don't mind not viewing the data, all I want is to hold it for later analysis, while avoiding writing to disc as I fear this will slow the process too much. Or would a different approach than simultaneous AIAO be more appropriate?
    I am using LabView 6.1 with 6024E DAQ card on a P-IV 1.5GHz.

    Use this vi MainProg.vi in the llb
    i use a same engine to acquire at 2 MS/s and generate at 3 MS/s
    "Fil" a ?crit dans le message de news:
    506500000008000000C8620000-1031838699000@exchange.​ni.com...
    > Is there a way to do simultaneous AI and AO and keep the data in the
    > buffer until I am finished with reading, then read the buffer and save
    > the data to disc. I want to acquire 1000 scans on up to 10 chanels at
    > 10 000 Scans/s, while generating one output signal.
    > I have seen plenty of continuous AIAO examples, but all they do is
    > show the data. I don't mind not viewing the data, all I want is to
    > hold it for later analysis, while avoiding writing to disc as I fear
    > this will slow the process too much. Or would a different appro
    ach
    > than simultaneous AIAO be more appropriate?
    > I am using LabView 6.1 with 6024E DAQ card on a P-IV 1.5GHz.
    [Attachment 4x10KSps to Disk& generate AO.llb, see below]
    Attachments:
    4x10KSps_to_Disk&_generate_AO.llb ‏128 KB

  • User Exit for CO01/CO02 : How to check production order before saving ?

    Hi all,
    I try to check production order before saving.
    if  AFPO-LGORT or RESB-LGORT  or some other field is initial, throw an error msg and stop saving process.
    I try using badi WORKORDER_UPDATE and user exit PPCO0001  EXIT_SAPLCOBT_001, find out that i can check the data but can't stop the saving process.
    Anyone knows some other user exits can do this?
    Thanks a lot.

    Solved.
    A wired solution from
    http://abaplog.wordpress.com/2007/03/01/reading-other-programs-data-using-field-symbols-in-abap/

  • How can I save a named filter and sorting for later use?

    I regularly do several different complex filtering and sorting on large tables. I did not find a way to save them for later one-click reuse. So I always have to do it again, which is time-consuming and error-prone. Hoped to get a solution by AppleScript, but filter and sort is not accessible by scripting.
    Is there a way or does Apple have it on it´s agenda for future versions of Numbers? 

    Hi Jan,
    filter and sort is not accessible by scripting.
    There is some support for sort (and less for filter) in Numbers 3.
    Table has a filtered property.
    And you can sort.
    A sort example can be found at https://iworkautomation.com/numbers/table-sort.html.
    Not sure if this will be sufficient to handle your needs, but just wanted to point out there is some scripting support.
    SG

Maybe you are looking for

  • Disk could not be read from or written to? Why won't my show download?

    Everytime I try to download the latest episode of Grey's Anatomy, the show starts to download and gets toward the end, but then says Error: Disk could not be read from or written to. Other short movies and music have downloaded fine; it's just this o

  • Header in second page

    Hi Experts I have prepared a report A/R Invoice in PLD. In that report there are 30 items which spans  in 3 pages.. Now in every page the header and footer is repeated....I don't want that.. how to prevent the header in 2nd and 3rd page. warm regards

  • How can I deauthorize my account without having my previous laptops?

    I change my laptop a lot and now I bought a new laptop, but somehow I can't authorized my account in itunes because it said max to 5 computer. The laptop that I used previously have given to others. How can I deauthorize my account without having tho

  • Sync Palm Centro with Windows Vista's Calendar (not Outlook).

    I am unable to find any information (ast least so it makes sense to me) that would explain how to actually sync between the calendar app that comes with Vista rather than Outlook. Can anybody tell me whether I can do this?  If so, how????  Thank you

  • Output forrmats for SAP documents

    Hi, I am trying to set up our SAP system such that all SAP documents are sent with HTML attachments. I have gone into transaction SCOT and under the 'Output formats for SAP documents' section, I tried to select the HTM option for SAPSCripts/Smart For