How to add data in the saved spreadshee​t file

Hi all,
I am having trouble in adding data onto an already saved spreadsheet file. I don't want to overwrite the old file but modify it, such that the new data is stored below the old data. Or
As I am saving the data in a 2-D array in the VI, where the first row of the array is occupied only, each time I take new measurements the old data is lost, is there a way to keep the old data and store the new one below the old data in the same array. Any help in this matter would be appreciated.
Regards
Ibtasam
Message Edited by Ibtasam on 07-11-2007 05:58 AM
In the name of Allah, the most mercifull and the most Gracious

Hi all,
I have actually managed to find a way to add comments before saving the data. Following steps are followed:
1.) Add a table on the front panell
2.) Connect the table as an indicator to the output array
3.)Finally make a varaible by right clicking on the table indicator (Block diagram) and connect this variable as an input to the Write to Spreadsheet.vi
this way you get the array output into the table and you can add comments in the table and then save it. If any body need any more information then please let me know
regards
Ibtasam
In the name of Allah, the most mercifull and the most Gracious

Similar Messages

  • How to add attribute to the elements in XML file in BPEL transformation

    Hi All-
    I have to create a XML file using transformation and file adapater and the parent element is USERRECORDS, now when I am creating the XML file using transformation the XML get creates like
    <?xml version="1.0">
    <USERRECORDS>
    so on
    But I want the parent element and the xml version tags as:
    <?xml version="1.0" encoding="UTF-8"?>
    <USERRECORDS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd">
    as I need to add the attributes.
    Is it possible in transformation?
    Any idea, please suggest.
    Thanks and Regards,
    Sreejit

    I have never come across any functionality like that.
    However I assigned values to attributes in Assign Acitivity using XML Fragment on source side.

  • How To ADD Child inside the childe in XML File

    I want to write setting file using XML toolkit.
     in that I am facing proble to add child in side the child.
    Please Guide me to resilve this problem.
    Thanks
    Prabhakant Patil
    Regards
    Prabhakant Patil
    Solved!
    Go to Solution.

    Perhaps it would be also helpfull if you post your code.
    Attachments:
    testxml.vi ‏12 KB

  • CRM ISA 5.0 - Add data to the WebCatArea

    Hello experts
    I have to associate an integer value to the WebCatAreas. This value is 1 for the first head webcatarea of catalog and all its childrens, 2 for the next ...
    I can generate this value in CategoriesB2C.inc.jsp in the menu displaying loop.
    I have to get this value in all the products jsp pages (list of products of an area, product sheet page ...)
    But how to add data to the webcatarea bean ? should I use the addExtensionData (I don't have to store this data in the backend ...) ? should I use the userSessionData to store a table which do the mapping between areaID and my custom value ?
    Thank you for your help.

    Hello Sateesh Chandra,
    The need is simple : I have to integrate XiTi marking. In XiTi there is "level 2 sites" that have been defined in hard into XiTi interface, corresponding to my "head" categories, with numbers associated (category1 = 4, category2 = 5 ...).
    In all the pages of my site that "are into" a category, I have to put a javascript code, containing a variable that I have to set to the level 2 site number. For example if I'm in page Category1 / Family1 / Product1, the javascript variable will have to be 4. Idem for the page Family1 which contains the list of the family1 products ...
    The level 2 sites in XiTi have been created in the same order than my menu, so I though I could use the position of the head category in the menu to determine the level 2 site number (in case of a change in the CRM catalog, we will have to change the configuration of level 2 sites numbers in XiTi interface but it happen's very rarely).
    I will try with the getPosition method and I'll come back to see if you advise me a better solution.
    Thank you very much one more time !
    Regards
    JL.

  • How to get data into the mySQL database?

    First some background.
    I have a website that has outgrown its designed dimensions and is a huge burden to maintain. See PPBM5 Benchmark
    There is a lot of maintenance work involved, so I'm investigating a PHP/MySQL approach to easen the burden and to add functionality to the site. With the current Excel based structure and over 420 entries, it is cumbersome for me to maintain, but also for users to find what they need.
    A MySQL based dynamic structure is a lot easier and offers vastly more selection capabilities, like selecting only records that meet specific criteria.
    Data submission is done with a form, that contains most of the relevant data, but the drawack is that people submitting their data are often not technically inclined, give wrong answers due to a lack of understanding or making typo's. The test results are attached in one or two separate .txt files, but often they have not read the instructions correctly or did something wrong, so these attached .txt files can not be trusted automatically, they have to be checked before inclusion.
    These were my initial thoughts:
    1. Data collection:
    To avoid spending all our energy and time  on correcting typo's, getting missing data, correcting errors, I am  investigating the use of CPU-Z in Ghost mode to create a .txt or .html  file that contains all relevant hardware info we need and even more. It gives all the info we currently have, but adds  data like number of memory sticks, DDR timings, stock clock speed and  BCLK setting, video card info and VRAM size, etc.
    To see what I mean, run CPU-Z, go to the About tab and press the Save Report button and look at the results.
    This can all be done without user intervention in an automatic way, but  maybe I need to add an Auto-It file to the test to make it all run as  desired.
    If this works and I'm able to extract the relevant data from the created  file and can insert it into the database, we may be in business for the  next version of PPBM5.5 or PPBM6. It does require a modification to the instructions, making them a lot  easier, because there is less data to fill out.
    2. Data submission:
    The submission form can be simplified if  the CPU-Z data can be used. We have to create an automatic way to attach  the created .html file from CPU-Z to the submission form and we have to  streamline the Output.txt and Output-MPE.txt files to be more easily included in the 'form.lib.php' file. It  currently is manual labor and very time consuming.
    3. Adding to Database:
    I have to find a way to create database  records from the Gmail forms I receive. All incoming mail messages need  to be checked on relevancy and if relevant, need to be added  automatically to the database and then offered for approval before final inclusion in the database. Data included in the database  will then include submission date and time, Email address,  IP address  used, plus links to the files submitted and available on the website.
    4. Publication of the database:
    After approval of new records from step  3, all updates will be automatically applied to the database and  accessible for users. I do not yet intend to introduce a user account ,  requesting login before all functionality is accessible. Too much trouble and administration.
    Queries should be possible on things like CPU (check box), so include  17-920, i7-930, i7-950 but exclude i7-980X and i7-990X, Size of memory  (check box), Overclocked (boolean, yes, no), SSD as OS disk, and similar  options.
    The biggest problem is to keep the color grading and statistical  indicators (Top, D9, Q3, Med, Q1 and D1) intact on dynamically generated  queries. Say you make a query which results in 20 observations, this  should show the related colors and legends. Next query results in 48 observations and of course the color grading and legends  do need to reflect that. Question in my mind, does the RPI remain  constant, independent of the query or does that need to be recalculated  on the basis of the query?
    Next thing is to allow a user to select a specific observation and by  simply clicking on it be shown, in a separate window (detail page) or  accordion, all the CPU-Z related information about the hardware.
    The graphs, Top-20 and MPE Gains, need to be dynamically adjusted, based on the query used.
    5. Ideally, external links:
    In an ideal situation, one could link the  CPU-Z data to external price databases, looking up current prices for  CPU, memory, video card, disks, raid controller, etc. to get instant  BFTB charts, based on the query made. But that is the next step.
    Situation now:
    I have a MySQL database that is easily updated with the new submissions. Simply create a .CSV flie from the submitted forms and import that into the database. The bulk of the initial work is done.Lots remain to be done as you can see above, but that is for a later time.
    Question:
    I have this table, that needs to be filled with data in the submitted and attached files. Mr. X submitted his data and can be uniquely identified by his "Ref_ID". He attached one or two files in .TXT format with the relevant test data. These files are stored on the server with a concatenated name:
    "Ref_ID","-","filename"
    Say his Ref-ID is: 20110204-6cf5 and his submitted file is called: Output(99).txt then the file can be found on the server as
    20110204-6cf5-Output(99).txt
    I need to be able to open that comma delimited file, the contents may look like this: "439","1036","819","531" and insert these contents into the relevant record and fields.
    Graphically,
    is what I want to achieve.
    This being my first exposure to PHP/MySQL, you can imagine I'm not clear on how to go from here.
    Added complication is that I actually have 5 numbers to insert per record and two calculated fields, Total Score and RPI should be calculated fields. Haven't yet figured out how to handle calculated fields, maybe only in the PHP/HTML code and not in the database.
    I hope someone can help me.

    You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
    http://www.youtube.com/user/phpacademy
    http://www.youtube.com/user/betterphp
    http://www.youtube.com/user/flashbuilding
    And many more on my channel here
    http://www.youtube.com/user/Whisperingonthewind
    CMS's are easier to maintain, add edit and delete content.
    I have also recently bought a Book by David Powers Training from the Source very helpful.
    Anyway hope you get it sorted.

  • How to add data in a file

    hi,
    I have written following code.I have a file. i want to add data in this file.
    When i add data then data is added but i donnot get the previous data. What`s the problem of my code? Is there anyone can help me? how i will add data with the previous data? Please help me.
    String username=request.getParameter("UserName");
    String userage=request.getParameter("UserAge");
    String address=request.getParameter("UserAddress");
    String sex=request.getParameter("sex");
    FileWriter f = new FileWriter("d:\\download_dreamweaver\\Project_3\\WebContent\\SaveData.txt");
    f.append(username);
    f.close(); ith regards
    bina

    Looks like you're creating a new file (which overwrites the old one) every time. You need to open the file first and then append to it.

  • How to add date in XSLT?

    All,
    soa version: 11.1.1.4
    There is a requirement for me to add date to the current date in XSLT.  I searched in 'Data functions', there I couldn't find any pre-defined functions.  How do I achieve it in XSLT?  Any help is appreciated.
    thanks
    sen

    Hi Sen,
    You can do this using the below:
    <xsl:value-of select="xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'P1D')"/>
    You can change the P1D based on the number of days you want to add.
    For example 3 days = P3D
    Thanks,
    Deepak.

  • Can you add an Add Password to the Saved Password window?

    There are some sites that do not prompt Firefox to save my password.
    Is it impossible to add an Add Password to the saved passwords screen for times when I revisit the site?

    Make sure that you do not run Firefox in permanent Private Browsing mode (Never remember history).
    *https://support.mozilla.org/kb/Private+Browsing
    *Firefox > Preferences > Privacy > Firefox will: "Use custom settings for history"
    *Deselect: [ ] "Always use private browsing mode"
    The website might be using autocomplete=off to prevent Firefox from saving form data like name and password.
    *You can toggle the signon.overrideAutocomplete pref to true on the <b>about:config</b> page.
    *You can remove autocomplete=off with a bookmarklet to make Firefox store form data like names and passwords.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered
    Note that Firefox won't auto-fill saved form data automatically when autocomplete=off is used, so double-click the empty name field to get a drop-down list.
    *Saved Password Editor: https://addons.mozilla.org/firefox/addon/saved-password-editor/

  • How to add date with month after convert number to month?

    How to add date with month after convert number to month?
    Month Date Result
    24 21/11/09 24*(21/11/09)
    I want to add both the column and result should be 21/11/11
    Thanks
    Nihar

    Hmm,
    Because, you are using YYYY for '09'.
    SQL> ed
    Wrote file afiedt.buf
      1* select to_char(to_date('10/01/09','DD/MM/RRRR'),'DD/MM/YYYY') from dual
    SQL> /
    TO_CHAR(TO
    10/01/2009
    SQL> ed
    Wrote file afiedt.buf
      1* select to_char(to_date('10/01/09','DD/MM/YYYY'),'DD/MM/YYYY') from dual
    SQL> /
    TO_CHAR(TO
    10/01/0009Or with Add_months
    SQL> ed
    Wrote file afiedt.buf
      1* select to_char(add_months(to_date('10/01/09','DD/MM/YYYY'),36),'DD/MM/YYYY') from dual
    SQL> /
    TO_CHAR(AD
    10/01/0012
    SQL> ed
    Wrote file afiedt.buf
      1* select to_char(add_months(to_date('10/01/09','DD/MM/RRRR'),36),'DD/MM/YYYY') from dual
    SQL> /
    TO_CHAR(AD
    10/01/2012-Arun

  • Reg:How to add fields to the scripts in detail

    How to add fields to the scripts in detail.
    Plz give me one example help me out.

    Hi
    add fields to the scripts by sending that field between  two &s.
    for example if u want to add lifnr of lfa1 table then pass field like this.
    &wa_lfa1-lifnr&.here wa_lfa1 is work area for internal table it_lfa1.
    if name1 then &wa_lfa1-name1&
    in this way you can add fields to the script under any window.
    i am sending one example program for scripts.
    &--structure declaration--
    TYPES:BEGIN OF ST_LFA1,
          LIFNR TYPE LFA1-LIFNR,
          NAME1 TYPE LFA1-NAME1,
          LAND1 TYPE LFA1-LAND1,
          ORT01 TYPE ORT01,
          REGIO TYPE REGIO,
          END OF ST_LFA1.
    TYPES:BEGIN OF ST_EKKO,
          EBELN TYPE EKKO-EBELN,
          BUKRS TYPE EKKO-BUKRS,
          AEDAT TYPE EKKO-AEDAT,
          ERNAM TYPE EKKO-ERNAM,
          BSTYP TYPE EKKO-BSTYP,
          LIFNR TYPE EKKO-LIFNR,
          END OF ST_EKKO.
    TYPES:BEGIN OF ST_EKPO,
          EBELN TYPE EKPO-EBELN,
          EBELP TYPE EKPO-EBELP,
          LOEKZ TYPE EKPO-LOEKZ,
          AEDAT TYPE EKPO-AEDAT,
          MATNR TYPE EKPO-MATNR,
          NETWR TYPE EKPO-NETWR,
          END OF ST_EKPO.
    &--internal table,work area declaration--
    DATA:WA_LFA1 TYPE ST_LFA1,
         IT_LFA1 TYPE STANDARD TABLE OF ST_LFA1,
         WA_EKKO TYPE ST_EKKO,
         IT_EKKO TYPE STANDARD TABLE OF ST_EKKO,
         WA_EKPO TYPE ST_EKPO,
         IT_EKPO TYPE STANDARD TABLE OF ST_EKPO.
    &--data declaration--
    DATA:TOTAL TYPE EKPO-NETWR,
          V_EBELN TYPE EKKO-EBELN.
    data: v_item(20) type c.
    &--parameter for purchase document number--
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS P_PURDOC LIKE V_EBELN.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
      PERFORM GET_DATA_FROM_EKKO.
      PERFORM GET_DATA_FROM_LFA1.
      PERFORM GET_DATA_FROM_EKPO.
    &--grand total--
      LOOP AT IT_EKPO INTO WA_EKPO.
        TOTAL = TOTAL + WA_EKPO-NETWR.
        CLEAR WA_EKPO.
      ENDLOOP.
    &--open form--
      CALL FUNCTION 'OPEN_FORM'
       EXPORTING
        DEVICE                            = 'PRINTER'
        FORM                              = 'Z_50886_VENDOR'
        LANGUAGE                          = SY-LANGU
       EXCEPTIONS
         CANCELED                          = 1
         DEVICE                            = 2
         FORM                              = 3
         OPTIONS                           = 4
         UNCLOSED                          = 5
         MAIL_OPTIONS                      = 6
         ARCHIVE_ERROR                     = 7
         INVALID_FAX_NUMBER                = 8
         MORE_PARAMS_NEEDED_IN_BATCH       = 9
         SPOOL_ERROR                       = 10
         CODEPAGE                          = 11
         OTHERS                            = 12
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for header details--
      READ TABLE IT_EKKO INTO WA_EKKO INDEX 1.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'HEAD'
         WINDOW                         = 'HEADER'
       EXCEPTIONS
         ELEMENT                        = 1
         FUNCTION                       = 2
         TYPE                           = 3
         UNOPENED                       = 4
         UNSTARTED                      = 5
         WINDOW                         = 6
         BAD_PAGEFORMAT_FOR_PRINT       = 7
         SPOOL_ERROR                    = 8
         CODEPAGE                       = 9
         OTHERS                         = 10
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for item details--
      LOOP AT IT_EKPO INTO WA_EKPO.
      concatenate wa_ekko-ebeln wa_ekpo-ebelp into v_item.
        CALL FUNCTION 'WRITE_FORM'
         EXPORTING
           ELEMENT                        = 'ITEM'
           WINDOW                         = 'MAIN'
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.
    &--write form for vendor details--
      READ TABLE IT_LFA1 INTO WA_LFA1 INDEX 1.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'VENDOR'
         WINDOW                         = 'ADDRESS'
       EXCEPTIONS
         ELEMENT                        = 1
         FUNCTION                       = 2
         TYPE                           = 3
         UNOPENED                       = 4
         UNSTARTED                      = 5
         WINDOW                         = 6
         BAD_PAGEFORMAT_FOR_PRINT       = 7
         SPOOL_ERROR                    = 8
         CODEPAGE                       = 9
         OTHERS                         = 10.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    &--write form for grand total--
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        WINDOW                         = 'TOTAL'
    EXCEPTIONS
       ELEMENT                        = 1
       FUNCTION                       = 2
       TYPE                           = 3
       UNOPENED                       = 4
       UNSTARTED                      = 5
       WINDOW                         = 6
       BAD_PAGEFORMAT_FOR_PRINT       = 7
       SPOOL_ERROR                    = 8
       CODEPAGE                       = 9
       OTHERS                         = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    &--close form--
      CALL FUNCTION 'CLOSE_FORM'
       EXCEPTIONS
         UNOPENED                       = 1
         BAD_PAGEFORMAT_FOR_PRINT       = 2
         SEND_ERROR                     = 3
         SPOOL_ERROR                    = 4
         CODEPAGE                       = 5
         OTHERS                         = 6
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *&      Form  get_data_from_ekko
    FORM GET_DATA_FROM_EKKO .
      SELECT EBELN
             BUKRS
             AEDAT
             ERNAM
             BSTYP
             LIFNR
          FROM EKKO INTO TABLE IT_EKKO WHERE EBELN = P_PURDOC.
    ENDFORM.                    " get_data_from_ekko
    *&      Form  get_data_from_lfa1
    FORM GET_DATA_FROM_LFA1 .
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT LIFNR
               NAME1
               LAND1
               ORT01
               REGIO
               FROM LFA1 INTO TABLE IT_LFA1 FOR ALL ENTRIES IN IT_EKKO WHERE
                    LIFNR = IT_EKKO-LIFNR.
      ENDIF.
    ENDFORM.                    " get_data_from_lfa1
    *&      Form  get_data_from_ekpo
    FORM GET_DATA_FROM_EKPO .
      IF NOT IT_EKKO[] IS INITIAL.
        SELECT EBELN
               EBELP
               LOEKZ
               AEDAT
               MATNR
               NETWR
               FROM EKPO INTO TABLE IT_EKPO
               WHERE EBELN = P_PURDOC.
      ENDIF.
    ENDFORM.                    " get_data_from_ekpo

  • Add data to the table in the database with the use of add button

    The name of my database is Socrates.
    The name of the table in the database is Employees
    I want to be able to add data to the database. i am presently working on the add button such that when i enter date into the textfield and press the add button it should automatically register in the table.
    The error upon compilation is with this line of code
    If (ae.getSource() == jbtnA)// it says that ";" is expected
    Below is the entire code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Mainpage extends JFrame implements ActionListener
         JTextField jFirstName = new JTextField(15);
         JTextField jSurname = new JTextField(12);
         JTextField jCity = new JTextField(10);
         JTextField jCountry = new JTextField(12);
         JTextField jSSN = new JTextField(8);
         JLabel jFirstLab = new JLabel("First Name");
         JLabel jSurnameLab = new JLabel("Surname");
         JLabel jCityLab = new JLabel("City");
         JLabel jCountryLab = new JLabel("Country");
         JLabel jSSNLab = new JLabel("Social Security Number (SSN)");
         JButton jbtnA = new JButton ("Add");
         JButton jbtnPrv = new JButton ("Previous");
         JButton jbtnNt = new JButton ("Next");
         JButton jbtnDl= new JButton ("Delete");
         JButton jbtnSrch = new JButton ("Search");
         public Mainpage (String title)
              super (title);
              Container cont = getContentPane();
              JPanel pane1 = new JPanel();
              JPanel pane2 = new JPanel();
              JPanel pane3 = new JPanel();
              pane1.setLayout (new GridLayout (0,1));
              pane2.setLayout (new GridLayout(0,1));
              pane3.setLayout (new FlowLayout());
              pane1.add(jFirstLab);
              pane1.add(jSurnameLab);     
              pane1.add(jCityLab);
              pane1.add(jCountryLab);
              pane1.add(jSSNLab);
              pane2.add(jFirstName);
              pane2.add(jSurname);
              pane2.add(jCity);
              pane2.add(jCountry);
              pane2.add(jSSN);
              pane3.add(jbtnA);
              pane3.add(jbtnPrv);
              pane3.add(jbtnNt);
              pane3.add(jbtnDl);
              pane3.add(jbtnSrch);
              cont.add(pane1, BorderLayout.CENTER);
              cont.add(pane2, BorderLayout.LINE_END);
              cont.add(pane3, BorderLayout.SOUTH);
              jFirstName.addActionListener(this);
              jSurname.addActionListener(this);
              jCity.addActionListener(this);
              jCountry.addActionListener(this);
              jSSN.addActionListener(this);
              jbtnA.addActionListener(this);
              jbtnPrv.addActionListener(this);
              jbtnNt.addActionListener(this);
              jbtnDl.addActionListener(this);
              jbtnSrch.addActionListener(this);
              validate();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setResizable(false);
         public void actionPerformed(ActionEvent ae)
                   If (ae.getSource() == jbtnA)
                                    fst = jFirstName.getText();
                        srn = jSurname.getText();
                        cty = jCity.getText();
                        cnty = jCountry.getText();
                        int sn =
    Interger.parseInt(jSSN.getText());
                                    String ad = "Insert into Employees
    (Firstname,Surname,City,Country,SSN)" +
    "values('"fst"','"srn"','"cty"','"cnty"','"sn"')";
                        Statement stmt = con.createStatment();
                        int rowcount = stmt.executeUpdate(ad);
                        JOptionPane.showMessageDialog("Your
    details have been registered");
                        Statement stmt = con.createStatment();
                        int rowcount = stmt.executeUpdate(ad);
    public static void main (String args[])
              Mainpage ObjFr = new Mainpage("Please fill this
    registration form");
              try
                   Class.forname("sun.jdbc.odbc.JdbcOdbcDriver");
                   String plato = "jdbc:odbc:socrates";
                   Connection con =
    DriverManager.getConnection(plato);
              catch(SQLException ce)
                   System.out.println(ce);
    }

    i have restructured the code, but the following line of code is giving error:
    String plato = jdbc:odbc:socrates;
    the entire code is below:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class Mainpage extends JFrame implements ActionListener
         JTextField jFirstName = new JTextField(15);
         JTextField jSurname = new JTextField(12);
         JTextField jCity = new JTextField(10);
         JTextField jCountry = new JTextField(12);
         JTextField jSSN = new JTextField(8);
         JLabel jFirstLab = new JLabel("First Name");
         JLabel jSurnameLab = new JLabel("Surname");
         JLabel jCityLab = new JLabel("City");
         JLabel jCountryLab = new JLabel("Country");
         JLabel jSSNLab = new JLabel("Social Security Number (SSN)");
         JButton jbtnA = new JButton ("Add");
         JButton jbtnPrv = new JButton ("Previous");
         JButton jbtnNt = new JButton ("Next");
         JButton jbtnDl= new JButton ("Delete");
         JButton jbtnSrch = new JButton ("Search");
         Statement stmt;
            String ad;
            public Mainpage (String title)
              super (title);
              Container cont = getContentPane();
              JPanel pane1 = new JPanel();
              JPanel pane2 = new JPanel();
              JPanel pane3 = new JPanel();
              pane1.setLayout (new GridLayout (0,1));
              pane2.setLayout (new GridLayout(0,1));
              pane3.setLayout (new FlowLayout());
              pane1.add(jFirstLab);
              pane1.add(jSurnameLab);     
              pane1.add(jCityLab);
              pane1.add(jCountryLab);
              pane1.add(jSSNLab);
              pane2.add(jFirstName);
              pane2.add(jSurname);
              pane2.add(jCity);
              pane2.add(jCountry);
              pane2.add(jSSN);
              pane3.add(jbtnA);
              pane3.add(jbtnPrv);
              pane3.add(jbtnNt);
              pane3.add(jbtnDl);
              pane3.add(jbtnSrch);
              cont.add(pane1, BorderLayout.CENTER);
              cont.add(pane2, BorderLayout.LINE_END);
              cont.add(pane3, BorderLayout.SOUTH);
              jFirstName.addActionListener(this);
              jSurname.addActionListener(this);
              jCity.addActionListener(this);
              jCountry.addActionListener(this);
              jSSN.addActionListener(this);
              jbtnA.addActionListener(this);
              jbtnPrv.addActionListener(this);
              jbtnNt.addActionListener(this);
              jbtnDl.addActionListener(this);
              jbtnSrch.addActionListener(this);
              validate();
              setVisible(true);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              pack();
              setResizable(false);
              try
                   Class.forname(sun.jdbc.odbc.JdbcOdbcDriver);
                   String plato = jdbc:odbc:socrates;
                   Connection con = DriverManager.getConnection(plato);
                   stmt = con.createStatment();
              catch(SQLException ce)
                   System.out.println(ce);
              catch(ClassNotFoundException ce)
                   System.out.println(ce);
         public void actionPerformed(ActionEvent ae)
                   try
                        if(ae.getSource().equals(jbtnA))
                                         fst = jFirstName.getText();
                             srn = jSurname.getText();
                             cty = jCity.getText();
                             cnty = jCountry.getText();
                             int sn = Interger.parseInt(jSSN.getText());
                                         ad = "Insert into Employees
    values('"+fst+"',"+srn+"','"+cty+"','"+cnty+"','"+sn+"')";
                             stmt.executeUpdate(ad);
                             JOptionPane.showMessageDialog(this, "Your details have been
    registered");
                   catch(SQLException ce)
                        System.out.println(ce);
    public static void main(String args[])
              Mainpage ObjFr = new Mainpage("Please fill this registration form");
    }

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to add spaces at the end of record

    Hi Friends,
    i am creating a file which contains more than 100 records.
    In ABAP i have internal table with on field(135) type c.
    some time record have length 120, somtime 130 its vary on each record.
    but i would like to add space at the end of each record till 135 length.
    Can you please help me how to add speace at the end of record.
    regards
    Malik

    So why did you said that in your first posting? My glass sphere is out for cleaning...
    Instead of type c use strings and add spaces until they have the appropriate length.
    loop at outtab assigning <pout>.
      while strlen( <pout>-val ) < 135.
        concatenate <pout>-val `` into <pout>-val.
      endwhile.
    endloop.

  • I recently transferred my ITunes library to an external hard drive.  I made sure to copy all the data from the saved location.  After the transfer I noticed that a lot of albums are missing the first song and some recently purchased albums are missing.

    I recently transferred my ITunes library to an external hard drive.  I made sure to copy all the data from the saved location.  After the transfer I noticed that a lot of albums are missing the first song and some recently purchased albums are missing.  Is there any way to recover the data?  Thanks for any help.

    I may have found an answer here:
    http://www.ilounge.com/index.php/articles/comments/moving-your-itunes-library-to -a-new-hard-drive
    They only thing I can assume is that my external hard drive was slow to start and iTunes defaulted to its old directory (see the last paragraph at the link above). However, once my external was recognized shouldn't everything have fixed itself?
    Message was edited by: williamson42
    Message was edited by: williamson42

  • How to process data in the past based from data in the present

    hello guys,
    i have a problem in my labview programs. how to process data in the past based from data in the present ?
    i have a formula self-organizing maps
    this formula is looking for D1, D1 is neuron index that will be searched for the smallest value.and the result are D1=2 ,D2=5, D3=17 from calculating with formula  .it means the smallest value is 2, "2" from weight [2 2] in file attached.
    and then it will be in other formula
    it mean [2 2] + 0.5 ( [1 1]-[2 2] ) = [1.5 1.5]
    and the weight will be  [1.5 2 2 ] in matrix
                                              1.5 3 5
    I would appreciate any input/help on solving this
    thanks
    Attachments:
    dika.vi ‏16 KB
    weight.txt ‏1 KB
    data .txt ‏1 KB

    Hi Ronny Hanks,
    Moving your records from internal table into the database table depends upon various scenarios :-
    1. If you use INSERT statement.
    INSERT <database_table> FROM TABLE <internal_table>.
    But in this case, you need to make sure that you don't have any duplicate entries in your internal table that violates data entry into database table, else you will get a dump.
    INSERT <database_table> FROM TABLE <internal_table> ACCEPTING DUPLICATE KEYS.
    In this case, you are forcefully inserting duplicate records into your database table which may lead to data redundancy in your database table.
    2. If you use UPDATE statement.
    UPDATE <database_table> FROM TABLE <internal_table>.
    This will update the existing records in your database table from the internal table.
    3. If you use MODIFY statement.
    MODIFY <database_table> FROM TABLE <internal_table>.
    This statement works both in combination of INSERT & UPDATE statements.
    Existing records (in database table) will be eventually updated/modified and new records (not in database table currently) will be successfully inserted into the database table.
    Hope this solves your problem.
    Thanks & Regards.
    Tarun Gambhir.

Maybe you are looking for

  • SAP ISA R/3 Edition problem with TREX

    Hi! We are migration our Internet Sales (R/3 Edition) 4.0 with SAP J2EE Engine 6.20 to SAP J2EE Engine 6.40. We’ve already migrate your Java Basket data. And we’ve installed TREX 6.1 for catalogue replication and we’ve created a WEB SITE in IIS. We’v

  • Cannot bring instance up due to datafile related error

    DB Version: Oracle8i Enterprise Edition Release 8.1.7.2.0 After a system crash(AIX), when i try to start the instance i am getting the below mentioned error. $ sqlplus "/as sysdba" SQL*Plus: Release 8.1.7.0.0 - Production on Fri Jul 18 05:03:20 2008

  • Shared object identification

    Suppose I write a function that is to reside inside a shared object. I need to know the name of the shared object programmatically. Is this possible, and if so, how might I do this?

  • The 911 operator could not hear me.

    I called in a power outage last night. The 911 operator could not hear but half of what I said. I was standing outside. If I go in my house, many calls drop or I can only hear half. I have been to the store twice and they say it's fine. I did not do

  • Toddler hit buttons during upgrade, Lost iTunes

    I was upgrading iTunes for Windows Vista when my daughter ran over and started hitting keys. It canceled the download and I restarted my laptop. When it restarted, iTunes completely disappeared. My music is still on my computer, just not iTunes. When