How to store measurement data in a single database row

I have to store time-data series into a database and do some analysis using Matlab later. Therefore the question might be more a database question rather than Diadem itself. Nevertheless I'm interested if anyone has some best practices for this issue.
I have a database which holds lifecycle records for certain components of same nature and different variants. Depending on the variant I have test setups which record certain data. There is a common set of component properties and a varying number of environmental measurements to be included. Also the duration of data acquisition varies across the variants.
Therefore having tables appears to be non-optimal solution for storing the data because the needed number of columns is unknown. Additionally I cannot create individual tables for each sample of a variant. This would produce to many tables.
So there are different approaches I have thought of:
Saving the TDM and TDX files as text respectively as BLOB
This makes it necessary to use intermediate files.
Saving the data as XML text
I don’t know yet if I can process XML data in Matlab
Has anybody an advice on that problem?
Regards
Chris

Chris
Sorry for the lateness in replying to your post. 
I have done quite a bit of using a Database to store test results.  (In my case this was Oracle DB, using a system called ASAM-ODS)
My 2 Cents:
Three functions were needed by users for me.  1) To search and find the tests,  and  2)  To take the list of Tests and process the data into a report/output summary. 2) If the file size is large, then being able to import the data quickly into analysis tool speeds up processing.
1) Searching for test results.  This all depends on what parameters are of value for searching.  In practice this is a smaller list of values(usually under 20), but I have had great difficulty getting users to agree on what these parameters are. They tend to want to search for anything.   The organization of the searching parameters has direct relationship to how you can search.   The NI Datafinder does a nice job of searching for parameters, so long as the parameter data are stored in properties of Channel Groups or Channels. It does not search or index if the values are in channel values.
Another note: Given these are searchable parameters, it helps greatly if these parameters have a controlled entry, so that the parameters are consistent over all tests, and not dependent on free form entry by each operator. Searching becomes impossible if the operators enter dates/ names in wildly different formats.
2) Similar issue exists if put values into databases. (I will use the database terms of Table and column(Parameter) and Row (instance of Data that would be one test record.)
The sql select statement, can do fast finds, if store the searchable parameters in rows of a table. Where would have one row for each Test Record.   The files I worked with have more than 2000 parameters.   Making a table that would store all of these, and be able to search for all of these, makes a very large number of rows. I did not like this approach, as it has substantial maintenance time, and when changes are made, things get ugly quick.
3)This is where having the file format be something that the analysis tool can quickly load up is beneficial.   Especially if the data files are large. In DIAdem's case, it reads TDM,TDMS files very quickly into the dataportal.   It can also read in the MDF or HDF files, but these are hierarchical structures that require custom code to traverse the information, and get the information into dataportal to use in Analysis /reporting. (Takes more time to read data, but have much more flexibility in the data structure than the two level tdm/tdms format.)
My personal preferences
I would not want to put the test data into a Table row. Each of the columns would be fixed and the table would be very wide in columns.
>
I personally like to put the test Data into a file, like TDMS, MDF, or HDF and then the database would have a entry for the reference to the attachment. The values that are in the database is just the parameters that are used for test Searching, either in datafinder or in sql commands in the user interface.
Hopefully these comments help your tasks some.
Respectfully,
Paul
tdmsmith.com

Similar Messages

  • How to delete multiple data domains with single step ?

    how to delete multiple data domains with single step ?

    You can go to your Endeca-Server domain home e.g.($WEBLOGIC-HOME$/user_projects/domains/endeca_server_domain/EndecaServer/bin)
    run
    [HOST]$ ./endeca-cmd.sh list-dd
    default is enabled.
    GettingStarted is enabled.
    endeca is enabled.
    BikeStoreTest is enabled.
    create a new file from the output just with the domains that you want to delete and then create a loop
    [HOST]$ vi delete-dd.list
    default
    GettingStarted
    endeca
    BikeStoreTest
    [HOST]$ for i in $(cat delete-dd.list); do; ./endeca-cmd.sh delete-dd $i; done
    Remember that this can not be undone, unless you have a backup.

  • How to store the data instead of memoryengine to database when use XML file

    Hi Experts,
    I have doubt which is into XML to database data transfer.
    While transferring the data from XML to database the tables will be store in memory for the xml files, my aim is instead of storing this in memory engine
    is there any way to store the data in to the data base itself..
    I am assuming when the data size increases say for example huge amount data, storing this much of data is big issue here right, so to avoid this is there any way to store
    this data directly in the database level.
    Please understand my requirement or else I have the good explanation about my requirement and please assist me how do this job....
    Thx,
    Sahadeva.

    Hi Experts,
    For this job I have applied the
    jdbc:snps:xmll?f=/mydata/xml/file.xml&s=wrk_admin&dp_driver=oracle.jdbc.driver.OracleDriver&dp_url=jdbc:oracle:thin:@localhost:1521:xel&dp_user=wrk_admin&dp_password=bPyXS2eRXw8fWnKEmTYSEf&dp_schema=wrk_admin&dp_doc=Y
    my schema name is wrk_admin
    xml file name is mydata
    jdbc driver: localhost:1521:xe
    Encoded password: I have encoded the pwd from cmd:c:oracle\oracle_odi1\oracledi\agent\bin\encode wrk_admin
    The above are the details I have applied to my ODI studio for creating the dataserver.
    After applying this I got the following error.
    Could you please correct me here if I am wrong...
    jdbc:snps:xml?param1=value1&param2=value2&...
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.doGetConnection(LoginTimeoutDatasourceAdapter.java:133)
         at oracle.odi.jdbc.datasource.LoginTimeoutDatasourceAdapter.getConnection(LoginTimeoutDatasourceAdapter.java:62)
         at com.sunopsis.sql.SnpsConnection.testConnection(SnpsConnection.java:1118)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.getLocalConnect(SnpsDialogTestConnet.java:420)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.localConnect(SnpsDialogTestConnet.java:860)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.jButtonTest_ActionPerformed(SnpsDialogTestConnet.java:806)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.connEtoC1(SnpsDialogTestConnet.java:165)
         at com.sunopsis.graphical.dialog.SnpsDialogTestConnet.access$1(SnpsDialogTestConnet.java:161)
    Thx,
    Sahadeva.

  • How to store the datas in a .txt file in to a JTable in Java Swing

    Hi sir,
    Here i want to know how to store the data's of a .txt file
    in to a JTable in java swing.
    Where here the .txt file like for eg,spooler.txt is in the server and from there it will come to my client machine what i have to do is to take that .txt file and store the datas of the .txt file
    in a JTable.This is what i want.So pls. do help and provide the code as well.I will be thankful.Since i am involved in a project which involves this it is Urgent.
    Thanx,
    m.ananthu

    You can't just display data from a text file in a JTable. You have you understand the structure of the data so that you can parse the data and create a table model that can access the data in a row/column format. Here is an example of a simple program that does this:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=315172

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • How to store the data coming from network analyser into a text or excel file

    Hii everyone
    I'm using Agilent 8719ET network analyser and wish to store the data coming from netowrk analyser into a text file/ excel file.
    Presently I'm able to get the data on Labview graph using GPIB . Can anyone suggest how to go ahead after collect data sub vi. How can the data be stored into a file apart from showing on the graph?
    Attached is the vi for kind consideration...
    Looking for help
    Regards
    Rohit
    Attachments:
    Agilent 87XX Series Exceed Max Meas.vi ‏43 KB

    First let me say that your code really looks pretty good. The data handling could be made more efficient by calculating the number of datapoints that are going to be in the completed dataset and preallocating the entire array -- but depending upon your answer to my questions, the logic in the lower shift register may be going away - so we won't worry about that right now.
    The thing I need to know before addressing the data storage question is: Each time you call "Collect and Display Data.vi", how many element are in the array? Are you reading single data points, or a group of data? (BTW: if the answer to that question is obvious based on the way the other VIs are setup, I don't have the drivers so I can't tell what the setup values are.) Second, how fast does the loop iterate? Are we talking msec per loop?, seconds? fortnights?
    The issues here are two-fold: how much data? and how fast is it coming? The answer to these will tell you how to save the data.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to store bit data in VARCHAR(4000) field?

    Hi.
    Please help!
    We are porting some C/C++ software with embedded SQLs from NT/DB2 to Linux/Oracle.
    On NT/DB2 we have some table to store file data in a VARCHAR(4000) blocks.
    Table looks like this
    CREATE TABLE FileData (filetime as timestamp not null, idx int not null, datablock varchar(4000) FOR BIT DATA not null, primary key (filetime, idx) );
    As you can see DB2 has appropriate field modifier - "FOR BIT DATA" which makes DB2 storing data as-is, not converting characters.
    I need to know - if it is possible to do the same in Oracle like in DB2?
    If Oracle has some kind of field modifier like "FOR BIT DATA" in DB2?
    If not, how can I do the same in Oracle?
    The current problems are:
    1) when application imports the file with some national chars the Oracle stores "?" in a database in place of national chars.
    2) another piece of a problem - if file is more than 4000 bytes length, it reports the ORA-01461 error (see it is trying to expand some chars to UTF8 char which is not fit a single char, so finally - not fit the field size).
    So, it seems that it cannot proceed national chars at all. :-\
    For details please see enclosed [C code|http://dmitry-bond.spaces.live.com/blog/cns!D4095215C101CECE!1606.entry] , there is example how data written to a table.
    In other places we also need to read data from FIELDATA table and store back to file (other filename, other location).
    Here is summary on a field-datatype variants I have tried for the "datablock" field:
    1) VARCHAR2, RAW, LONG RAW, BLOB - does not work! All reports the same error - ORA-01461.
    2) CLOB, LONG - both working fine but(!) both still returns "?" instead of national chars on data reading.
    Hint: how I did try these field types - I just drop the "FileData" table, created it using different type for "datablock" field and run the same application to test it.
    I think I need to explain what the problem - we do not provide direct access to Oracle database, we use a some middle-ware. Middle-ware is a C/C++ software which also has a interface for dynamic SQLs execution. So, exactly this middle-ware (which is typically running on the same server with Oracle) receives the "?" instead of national chars! But we need it to return all data AS-IS(!) without any changes!!! That is wjhy I did ask - if Oracle has any options to store byte-data as-is?
    The BIG QUESTION - HOW CAN WE DO THIS?!
    Another thing I need to explain - it is ok to use Oracle-specific SQL ONLY IF THERE IS REALLY NO WAY TO ACHIEVE THIS WITH STANDARD SQL! Please.
    So, please look on a C code (by link I have posted above) and tell - if it is possible to make working in Oracle the VARCHAR approach we using at the moment?
    If not - please describe what options do we have for Oracle?
    Regards,
    Dmitry.
    PS. it is Oracle 11gR2 on CentOS 5.4, all stuff installed with default settings, so Oracle db encoding is "AL32UTF8".
    C/C++ application is built as ANSI/ASCII application (non-unicode), so sizeof(char)=1.
    The target Oracle db (I mean - the one which will be used on customer site) is Oracle 10g. So, solution need to be working on Oracle 10g.

    P. Forstmann wrote:
    There is some contradiction in your requirements:
    - if you want to store data as is without any translation use RAW or BLOB
    - if you want to store national character data try to use NVARCHAR2 or NCLOB.Seems you did not understand the problem. Ok, I'll try to explain. Please look on the code sample I provided in original question
    (I just added expanded data structures there, sorry I forgot to publish them when post original question):
    EXEC SQL BEGIN DECLARE SECTION;
      struct {
        char timestamp[27];
        char station[17];
        char filename[33];
        char task[17];
        char orderno[17];
        long filelen;
      gFilehead;
      struct {
        char timestamp[27];
        long idx;
        struct {
          short len;
          char arr[4001];
        } datablock;
      gFiledata;
    EXEC SQL END DECLARE SECTION;
    #define DATABLOCKSIZE 4000
    #ifdef __ORACLE
      #define VARCHAR_VAL(vch) vch.arr
    #elif __DB2
    #endif
    short dbWriteFile( char *databytes, long datalen )
      short nRc;
      long movecount;
      long offset = 0;
      gFilehead.filelen = gFilehead.filelen + datalen;
      while ((datalen + gFiledata.datablock.len) >= DATABLOCKSIZE)
        movecount = DATABLOCKSIZE - gFiledata.datablock.len;
        memcpy(&VARCHAR_VAL(gFiledata.datablock)[gFiledata.datablock.len], databytes, movecount);
        gFiledata.datablock.len = (short)(gFiledata.datablock.len + movecount);
        exec sql insert into filedata (recvtime, idx, datablock)
          values(
            :gFiledata.recvtime type as timestamp,
            :gFiledata.idx,
            :gFiledata.datablock /* <--- ORA-01461 appears here */
        nRc = sqlcode;
        switch (nRc)
        case SQLERR_OK: break;
        default:
          LogError(ERR_INSERT, "filedata", IntToStr(nRc), LOG_END);
          exit(EXIT_FAILURE);
        offset = offset + movecount;
        datalen = datalen - movecount;
        gFiledata.idx = gFiledata.idx + 1;
        memset(&gFiledata.datablock, 0, sizeof(gFiledata.datablock));
        databytes = databytes + movecount;
        gFiledata.datablock.len = 0;
      if (datalen + gFiledata.datablock.len)
        memcpy(&VARCHAR_VAL(gFiledata.datablock)[gFiledata.datablock.len], databytes, datalen);
        gFiledata.datablock.len = (short)(gFiledata.datablock.len + datalen);
      return 0;
    }So, the thing we need is - to put some data into the "datablock" field of following structure:
      struct {
        char timestamp[27];
        long idx;
        struct {
          short len;
          char arr[4001];
        } datablock;
      gFiledata;Then insert it into a database table using static SQL like this:
        exec sql insert into filedata (recvtime, idx, datablock)
          values(
            :gFiledata.recvtime type as timestamp,
            :gFiledata.idx,
            :gFiledata.datablock /* <--- ORA-01461 appears here */
            ); And then expect to read exactly the same data back!
    The problems are:
    1) Oracle make decision to convert the data we are inserting (why? and how to disable converting?!)
    2) even if it inserts the data (CLOB and LONG field datatypes are working fine when inserting data with such static SQL + such host variable) then it became not readable! (why?! how to make it readable?!)
    P. Forstmann wrote:
    ORA-01461 could mean that you have a wrong data type for bind variable variable in your client code:Not me decided that host variable is the "LONG datatype value" - the Oracle make that decision instead of me. And that is the problem!
    Looks like Oracle react on any char code >= 0x80.
    So, assume if I run the code:
    // if Tab1 was created as "CREATE TABLE Tab1 (value VARCHAR(5))" then
    char szData[10] = "\x41\x81\x82\x83\x84";
    EXEC SQL INSERT INTO Tab1 (value) VALUES (:szData);
    Oracle will report the ORA-01461 error!
    EXACTLY THIS IS THE PROBLEM I HAVE DESCRIBED IN MY ORIGINAL QUESTION.
    So, problem - why Oracle make such decision instead of me?! How we can make Oracle insert data into a table AS-IS?
    What other type of host variable we should use to make Oracle think that data is a binary?
    void*? unsigned char? Could you please provide any examples?
    Ok, you did recommend - "use the RAW datatype". But RAW datatype is limited to size 2000 bytes only - we need 4000! So, it is not match our needs at all.
    Also you have mentioned "use BLOB" - but testing shows that Oracle reports the same ORA-01461 error on inserting data into a BLOB field from such host variable! (see the code I posted)
    What also we can do?
    Change type of host variables? BUT HOW?!

  • How to store 2C array to a singl binary file

    Hi
    I have to store multiple waveforms output that is each 1D array to a single binary file. how do i do this.
    i can store 1D array to binary file and retrieve it by reading the binary file and plotting the waveform. but i am not able to store 2D array to the single file. how do store many 1D array in one binary file,
    Thank you. Hema

    (We would also need to know your LabVIEW version. If you have a very old version, things would be quite different.)
    As Smercurio_fc already mentioned, the option to "prepend array size" would make things much easier here, because then you would read it as a single 2D array.
    Here's how that would look like. This is probably the recommended solution, just for simplicity reasons.
    Not prepending the size is more useful if you write the data in increments, but later want to read it as one.
    Message Edited by altenbach on 11-15-2008 09:02 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SaveRestore2D.png ‏21 KB

  • Store values of different data types into single database field

    Hi Friends,
      I  have to store values of different data types(character, numeric, date, time,  text, etc) into a single database field(Char 80). Then read the same values and display it into ABAP Webdynpro report. 
    Appreciate any ideas, examples, suggestions.
    Thanks
    JB

    Hi,
    Try like this:
    data: txt1 type string,
          var1(1) type c,
          var2(1) type n,
          var3 like sy-datum,
          var4 like sy-uzeit.
    parameters: a type c,
                b type n,
                c like sy-datum,
                d like sy-uzeit.
    concatenate a b c d into txt1.
    write txt1.
    var1 = txt1+0(1).
    var2 = txt1+1(1).
    var3 = txt1+2(8).
    var4 = txt1+8(8).
    write: / var1,
           / var2,
           / var3,
           / var4.
    Regards,
    Bhaskar

  • How to store multiple data in one aray at one go?

    Hi i am creating a Recipe Cooking Book and i have got a recipe class, ingredient class, equipment class and jFORM GUI. the gui form will have a list and it will contain couple of equipments. the user should be able to select more than 1 equipments which would use the pass- by - value to the recipe class and it will be passed to equipment class.
    The problem that encounter is that when i have to select multiple values from list, it should store all selected equipments to array.
    This is where i am stuck as i don't know how to store couple of equipment at one creation.
    This is my recipe constructor in recipe class
    public Recipe(int aRecipeID, String aRecipeName, String aCountryofOrigin,
                      String aType, String aPreparationTime, String aCookingTime,
                      String aRecipeDescription, String aProcedure,
                       ClsEquipment[] aequipment, String aImage1, String aImage2,
                      String aImage3) {
            Create(aRecipeID, aRecipeName, aCountryofOrigin, aType,
                   aPreparationTime, aCookingTime, aRecipeDescription, aProcedure,
                   aequipment, aImage1, aImage2, aImage3);
        public void Create(int aRecipeID, String aRecipeName,
                           String aCountryofOrigin, String aType,
                           String aPreparationTime, String aCookingTime,
                           String aRecipeDescription, String aProcedure,
                            ClsEquipment[] aequipment, String aImage1, String aImage2,
                           String aImage3) {
            RecipeID = aRecipeID;
            RecipeName = aRecipeName;
            CountryofOrigin = aCountryofOrigin;
            Type = aType;
            PreparationTime = aPreparationTime;
            CookingTime = aCookingTime;
            RecipeDescription = aRecipeDescription;
            Procedure = aProcedure;
            *equipment[j] = aequipment[k];*
            Image1 = aImage1;
            Image2 = aImage2;
            Image3 = aImage3;
    this is The command that i have in Jform gui
        public void jRcreateButton_actionPerformed(ActionEvent e) {
            int i=0;
    myRecipe.Create(Integer.parseInt(jRidTextField.getText()),jRnameTextField.getText(),jRcountryTextField.getText(),jRtypeTextField.getText(),jRptimeTextField.getText(),jRctimeTextField.getText(),jRdescriptionTextArea.getText(), jRprocedureTextArea.getText(),new ClsEquipment(jAEequipmentList.getSelectedValues()),jRimage1TextField.getText(),jRimage2TextField.getText(),jRimage3TextField.getText());
    Let me conclude what i am trying to do. Basically i want the user to select more than 1 equipments from the List and the user should also input other recipe data. once this is done, the should click on create.
    when creating one recipe, u need more than 1 equipment so that created recipe should store selected equipments, which i will later on retrieve  and display on screen.
    can u please guide me where i am goin wrong and how i could fix it.
    thank you in advance
    Edited by: JAVABABY on Feb 18, 2008 8:40 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

           *equipment[j] = aequipment[k];*JList's getSelectedValues() method returns an array of Objects, so if you wanted to store it into another Object[] reference, you'd just use
    equipment = aequipment;But, you are storing it as an Equipment array, so you'll need to loop over the Object array and cast each element to an Equipment reference, and store it into the Equipment array. Something like this:
    equipment = new Equipment[aequipment.length];
    for (each element x in aequipment) {
        equipment[x] = (Equipment)aequipment[x];
    }

  • How to store the data of a file into an ArrayList?

    Hi! everyone.
    I want to know
    if I have a File, and the data in the file are type int, type String...
    And I have a ArrayList which is of type Question
    How do I store the data of that file into the ArrayList
    I tried to use the while loop(use the hasNextLine() to read the data line by line)
    But I cannot add data which are not of type Question to the ArrayList.
    Can you tell me what I should do, please?
    I also wonder that
    The data of the file are of many types, but when I try to read it with the nextLine(), the data all turn out to be of type String. Why?
    Thank you.
    Edited by: Terry001 on Apr 30, 2008 1:13 PM

    No, a line in the file is just part of a question
    The format of the file is like this:
    *<question type code>                    :     String*
    *<question point value>                    :     int*
    *<question category>                         :     String*
    *<question difficulty level>               :     int*
    *<question text>                              :     String*
    *<question correct answer>               :     String*
    *<optional question-specific data>     :     String*
    *<question terminator>                    :     String*
    And here is an example
    TF //TrueFalseQuestion
    5 //points value
    None //category
    3 //difficulty level
    The capital of the United States is Washington, D.C. //question text
    True // answer
    *** //quetion terminator
    I created an ArrayList in the Test class:
    private ArrayList<Question> questions; // Create inside constructor
        public Test (String name, String instr)
            testName = name;
            scoreEarned = 0;
            scorePossible = 0;
            instructions = instr;
            questions = new ArrayList<Question>(); //[MAX_NUMBER_OF_QUESTIONS];
        }And I tried to use the following method to store the data of the file to the ArrayList
    // This method loads a set of questions from a plain text file
        public void loadQuestionsFromFile(String fileName) throws FileNotFoundException
            try
                File fileReader = new File("input.txt");
                Scanner sc = new Scanner(fileReader);
                while (sc.hasNextLine())
                    // I don't know how to pass the data I got from the nextLine() method to the ArrayList because they are of different type
            catch (FileNotFoundException a)
                System.out.println(a);
        }    As all you said, I should create an Question object in the while loop
    Question temp = new Question ();But I have no idea how to pass the int and String to the Question object.
    Thank you

  • How to store the data captured from oscillosco​pe into the MS Access database table

    Hi All,
    In my application, I tried to save the data captured from SCOPE, but could store only 200 bytes. I've taken the Memo data type for the field in database. I want to store all data ( 4 channels) in one field & retrieve back and display on the XY Graph.
    Thanks in advance.
    Regards,
    Shrini

    kramish wrote:
    Im pretty sure that Access does support JDBCNo it does not. It supports ODBC.
    just doing a quick Google came up with some pages:
    http://blog.taragana.com/index.php/archive/access-microsoft-access-database-from-java-using-jdbc-odbc-bridge-sample-code/
    http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
    Both articles explains how to use the jdbc-odbc bridge. I think I've seen a pure jdbc driver for access but it wasn't from Microsoft and it wasn't free.
    Kaj

  • How to store spry data in php array

    I am trying to store spry data in php array like this:
    <? $foo= array();?>
      <div spry:region="dsCALC">
        <div spry:repeat="dsCALC">
          <?php
    $foo[]='{dsCALC::DataPrice}';
    ?>
          </div>
      </div>
    <?var_dump($foo);?>
    Outputs:
    Array (     [0] => {dsCALC::DataPrice} )
    If I tried a variable, it works ok... The array, not... Any ideas?

    Outputs:
    Array (     [0] => {dsCALC::DataPrice} )
    And so it should, because that is what you told the PHP-script to do in the following line of code.
    $foo[]='{dsCALC::DataPrice}';
    Please remember that PHP code is handled on the server, whereas JavaScript (Spry) is handeld on the client (browser) end. JavaScript cannot be handeld by PHP nor can JavaScript handel PHP.
    My question to you is, why do you want to store the data in a PHP-array and how is the Spry data obtained?
    Ben

Maybe you are looking for

  • Bad Quality on Treo Pro!!!

    Warn u, I just got Treo Pro a couple days ago, after fully charged and tried using it. There WAS no keyboard backlight at all!!! I have been Palm user since Palm V, Treo 180,270,600,680, never got hardware problem (that's why I like Palm). But this t

  • Debug from BW?

    Hi experts, I have some trouble and i need to debug an extractor to solve it. But when i debug it from rsa3 en R3 i works ok, it only works badly when i execute the infopackage from BW. So, is there a way to start the extraction process from BW and d

  • Portal Runtime error when click on Permissions

    Hi, I have netweaver 640 running andI have got an exception as follows: An exception occurred while processing a request for : iView : pcd:portal_content/com.sap.pct/admin.templates/iviews/editors/com.sap.portal.aclEditor Component Name : com.sap.por

  • Editing hidden metadata in MP4?

    I've been trying to organize my music collection as of late, and this task includes cleaning up the metadata for more effecient viewing on my iPod.  I've come across a bit of a quandary, though, specifically regarding MP4s purchased directly through

  • Photoshop elements 12 freezes in Yosemite when attempting to select the spot heal tool.

    The program freezes and must be force quit. Photoshop Elements 8 still seems to work alright.