Moving data from an array to a JTable

Hi,
I am facing some problems with handling array data to JTable.
My objective is moving data from a 10X5 data array to a JTable.
I am using the following code:
String columnNames = { "Col 1", "Col 2", "Col 3", "Col 4", "Col 5" };
for(int j=0; j<10; j++)
data[ j ] = array1[ j ] + array2[ j ] + array3[ j ] + array4[ j ] + array5[ j ];
JTable table = new JTable( data, coulmnNames);
Can you please help me with the error in tha above code.My array1 is a String array and the other four arrays are of Integer data type.
Thanks!!!

hi,
The actual error message is:
[root@localhost java]# javac GUI.java
GUI.java:144: incompatible types
found : int
required: java.lang.Object
data [j] [1] = array1[j];
^
GUI.java:145: incompatible types
found : int
required: java.lang.Object
data [j] [2] = array2[j];
^
GUI.java:146: incompatible types
found : int
required: java.lang.Object
data [j] [3] = array3[j];
^
GUI.java:147: incompatible types
found : int
required: java.lang.Object
data [j] [4] = array4[j];
^
4 errors
My code segment with line no goes as follows:
private static JTable createTable() {         
       String[] columnNames = { "Col 1", "Col 2", "Col 3", "Col 4"' "Col 5" };
         Object data [ ] [ ] = new Object [10] [5];
   for( int j=0; j<10; j++)
          data [j] [0] = array1[j]; ...................Line:144
          data [j] [1] = array2[j]; ..................Line 145
          data [j] [2] = array3[j]; ....................Line 146
          data [j] [3] = array4[j]; .................Line 147
          data [j] [4] = array5[j];
  final JTable table = new JTable(data, columnNames);
  return table;
[code/]
Array 1 is declared as String array and Array 2,3,4,5 are declared as Integer arrays.The error is coming from the Integer arrays only.
Java version running on my machine is: 1.4.2
Please help!!!
Thanks!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • What is the best way to move data from one array to another

    I'm going to be moving data from one array to a larger array on the same RAID but different controller. (I have some extra extra drives I'm also going to be installing Retrospect so I can't just restore from a backup.)
    The RAID has 450GB of production files, fonts etc.
    What is the best way to move the data over?
    I saw that someone had suggested using ditto. Would that be better than MacMV?
    I also own Bru LE so I could use that.
    Any advice would be appreciated.
    Thanks,
    Paul

    Ditto is a great option -- probably the best.
    ditto -rsrc src_folder /Volumes/targetvolume/targetfolder

  • Without loops how can i read data from associative Array??

    Hi all,
    I am facing scenario like...
    i need to read data from associative array  without using loops is it possible,
    CREATE OR REPLACE PACKAGE BODY test_pkg IS
        TYPE t1 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
       -- in array we can expect more than one row or sometimes no data also.
      FUNCTION test1(vt1 T1 DEFAULT CAST(NULL AS t1)) RETURN NUMBER IS
      BEGIN
        -- basically in array we'll get data of column2
        -- this loop should satisfies table1.colum2 = nvl(NULL, table2.colum2 )if array is null.
        -- if array is not null then only compare with array values
        FOR i IN (SELECT t1.colum1,t1.column2
                         FROM table1 t1, table1 t2
                              WHERE t1.colum1 = t2.column1
                                AND t1.colum2 = nvl(vt1, t2.colum2)
          LOOP
            generateTEXT(i.colum1, i.colum2);
         END LOOP;
      END test1;
    END test_pkg;
    in table1 we have date like...
    colum1          column2
    Jan                  1
    Feb                  2
    Mar                  3
    if i call select test_pkg.test1(1) from dual then output should
    be Jan..
    and
    select test_pkg.test1(null) from dual then it should display all elements from table1.
    Jan                  1
    Feb                  2
    Mar                  3,
    Thanks for your quick replay..

    i need to read data from associative array  without using loops is it possible,
    No - you would need to create a SQL type and then use the TABLE operator to unnest the collection.
    create or replace TYPE my_nums IS TABLE OF INTEGER;
    DECLARE
    --  TYPE my_nums IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
      v_nums my_nums := my_nums(1, 2, 3);
      v_total number;
    BEGIN
      select sum(column_value) into v_total from table(v_nums);
      DBMS_OUTPUT.PUT_LINE
        ('Sum of the numbers is ' || TO_CHAR(v_total));
    END;
    Sum of the numbers is 6

  • Error while retrieving data from an ARRAY resultset

    We hava an Oracle stroed procedure which has a table type as its OUT parameter and where the data is being entered into. This data requries to be returned to the Java client through a JDBC connection. We have used the OracleTypes' ARRAY object for this. We are facing errors when retieving data from the ARRAY resultset
    The Oracle Package
    ----I created a table type called "PlSqlTable":
    CREATE OR REPLACE TYPE PlSqlTable IS TABLE OF VARCHAR2(20);
    ----I defined this as the out parameter for my procedure :
    PROCEDURE testSQL
    arrayOutID OUT PlSqlTable
    Then populated the object :
    arrayOutID := PlSqlTable();
    arrayOutID.extend(4);
    arrayOutID(1):= 'Hello';
    arrayOutID(2) := 'Test';
    arrayOutID(3) := 'Ora';
    ----The procedure executes fine - all debug statements are printed ----right till the end of execution.
    The Java class
    ----Here is how I have defined the parameters :
    OracleCallableStatement stmnt = (OracleCallableStatement)connection.prepareCall("begin testSQL(?);end;");
    stmnt.registerOutParameter(2,OracleTypes.ARRAY,"PLSQLTABLE");
    System.out.println("Executing..");
    stmnt.execute();
    System.out.println("Executed..");
    ARRAY outArray = stmnt.getARRAY(1);
    System.out.println("Got array");
    ResultSet rset = outArray.getResultSet();
    System.out.println("Got Resultset..");
    int i = 1;
    while(rset.next()){
    System.out.println("VALUE : " + rset.getString(i));
    i = i+1;
    ----On execution, the debug messages display :
    Executing..
    Executed..
    Got array
    Got Resultset..
    VALUE : 1
    VALUE : Test
    ERROR : java.sql.SQLException: Invalid column index
    ----But I have populated upto 3 values in th e procedure. Then why this error ?
    PLLLEEEASE help me out on this.
    Thanks, Sathya

    haven't worked with db arrays but I think your problem is here:int i = 1;
    while(rset.next()){
         System.out.println("VALUE : " + rset.getString(i));
         i = i+1;
    }In the first loop you are retrieving the value from column 1(rs.getString(1)), which is OK, but in the second loop, you are trying to retrieve a value from the second column(rs.getString(2)) which doesn't exist. Try this code which only reads from column1:
    while(rset.next()){
         System.out.println("VALUE : " + rset.getString(1));
    }Jamie

  • Which CKM is used for moving data from Oracle to delimited file ?

    Hi All
    Please let me know Which CKM is used for moving data from Oracle to delimited file ?
    Also is there need of defining each columns before hand in target datastore. Cant ODI take it from the oracle table itself ?

    Addy,
    A CKM is a Check KM which is used to validate data and log errors. It is not going to assist you in data movement. You will need an LKM SQL to File append as answered in another thread.
    Assuming that you have a one to one mapping, to make things simpler you can duplicate the Oracle based model and create a file based model. This will take all the column definitions from the Oracle based model.
    Alternatively, you can also use an ODI tool odiSQLUnload to dump the data to a file
    HTH

  • How to delete a particular data from 3 arrays

    hello,
    i have a program that works like this.....
    import java.io.*;
    public class NewMain {
    BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
    String [] Type= new String[10000];
    int [] Num= new int[10000];
    float [] Price= new float[10000];///////
    and i am reading some of the data into these arrays
    so if i want to delete a particular data from the arrays how do i do that
    and if i want to delete pants from that file and enter the text again how do i do that.? any idea?....
    e.g if the file contains
    shirt
    32
    56.5
    pants
    56
    45.9

    Ashish.Uppin wrote:
    hello,
    i have a program that works like this.....
    import java.io.*;
    public class NewMain {
    BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
    String [] Type= new String[10000];
    int [] Num= new int[10000];
    float [] Price= new float[10000];///////
    and i am reading some of the data into these arrays
    so if i want to delete a particular data from the arrays how do i do that
    and if i want to delete pants from that file and enter the text again how do i do that.? any idea?....
    e.g if the file contains
    shirt
    32
    56.5
    pants
    56
    45.9
    Buddy, it seems to me that you are describing data that belongs together -- a class. You are probably better off with one arraylist of objects of this class, each object having a String type variable, an int num variable, and a float price variable, make that a double price variable.
    For examples of arraylists in action, please see the Sun java tutorials.

  • Moving Data from Normal table to History tables

    Hi All,
    I'm in the process of moving data from normal tables to
    History tables.
    It can be some sort of a procedure which should be a cron job running at night.
    My aim is to move data say 1.5 yrs or 2yrs old data to History tables.
    What aspects i need to check when moving data. And how can i write a procedure for this requirement.
    The schema is same in both the normal table and history table.
    It has to be a procedure based on particular field RCRE_DT.
    If the rcre_dt is above 2 yrs the data needs to be moved to HIS_<table>.
    I have to insert record in to HIS_table and simultaneously delete record from the normal table.
    This is in Production system and the tables are quite big.
    Pls do find enclosed the attached sample schema for Normal table and HIS_<table>.
    If i want to automate this script as a Cron job for similarly other History tables
    how am i to do it in a single procedure assuming the procedure for moving the data is the same procedure.
    Thanks for ur help in advance.
    SQL> DESC PXM_FLT;
    Name Null? Type
    RCRE_USER_ID NOT NULL VARCHAR2(15)
    RCRE_DT NOT NULL DATE
    LCHG_USER_ID VARCHAR2(15)
    LCHG_DT DATE
    AIRLINE_CD NOT NULL VARCHAR2(5)
    REF_ID NOT NULL VARCHAR2(12)
    BATCH_DT NOT NULL DATE
    CPY_NO NOT NULL NUMBER(2)
    ACCRUAL_STATUS NOT NULL VARCHAR2(1)
    FLT_DT NOT NULL DATE
    OPERATING_CARRIER_CD NOT NULL VARCHAR2(3)
    OPERATING_FLT_NO NOT NULL NUMBER(4)
    MKTING_CARRIER_CD VARCHAR2(3)
    MKTING_FLT_NO NUMBER(4)
    BOARD_PT NOT NULL VARCHAR2(5)
    OFF_PT NOT NULL VARCHAR2(5)
    AIR_CD_SHARE_IND VARCHAR2(1)
    UPLOAD_ERR_CD VARCHAR2(5)
    MID_PT1 VARCHAR2(5)
    MID_PT2 VARCHAR2(5)
    MID_PT3 VARCHAR2(5)
    MID_PT4 VARCHAR2(5)
    MID_PT5 VARCHAR2(5)
    PAX_TYPE VARCHAR2(3)
    PAY_PRINCIPLE VARCHAR2(1)
    SQL> DESC HIS_PXM_FLT;
    Name Null? Type
    RCRE_USER_ID NOT NULL VARCHAR2(15)
    RCRE_DT NOT NULL DATE
    LCHG_USER_ID VARCHAR2(15)
    LCHG_DT DATE
    AIRLINE_CD NOT NULL VARCHAR2(5)
    REF_ID NOT NULL VARCHAR2(12)
    BATCH_DT NOT NULL DATE
    CPY_NO NOT NULL NUMBER(2)
    ACCRUAL_STATUS NOT NULL VARCHAR2(1)
    FLT_DT NOT NULL DATE
    OPERATING_CARRIER_CD NOT NULL VARCHAR2(3)
    OPERATING_FLT_NO NOT NULL NUMBER(4)
    MKTING_CARRIER_CD VARCHAR2(3)
    MKTING_FLT_NO NUMBER(4)
    BOARD_PT NOT NULL VARCHAR2(5)
    OFF_PT NOT NULL VARCHAR2(5)
    AIR_CD_SHARE_IND VARCHAR2(1)
    UPLOAD_ERR_CD VARCHAR2(5)
    MID_PT1 VARCHAR2(5)
    MID_PT2 VARCHAR2(5)
    MID_PT3 VARCHAR2(5)
    MID_PT4 VARCHAR2(5)
    MID_PT5 VARCHAR2(5)
    PAX_TYPE VARCHAR2(3)
    PAY_PRINCIPLE VARCHAR2(1)

    Hi All,
    Thanks for ur valuable suggestion.But can u explain me bit more on this as i'm still confused about switching between partitoned tables and temporary table.Suppose if i have a table called PXM_FLT and an correspoding similar table named HIS_PXM_FLT.How can i do the partitioning shd i do the partitioning on the normal table or HIS_PXM_FLT.i do have a date field for me to partition based on range.Can u pls explain why shd i again create a temp.table.What's the purpose.Now the application is designed in such a way that old records have to be moved to HIS_PXM_FLT.can u pls highlight more on this.Your suggestions are greatly appreciated.As i'm relatively new to this partitioning technique i'm bit confused on how it works.But i came to understand Partitioning is a better operation than the normal insert or delte as it is more data intensive as millions of record need to be moved.Thanks for feedback and ur precious time.

  • Moving data from flat file

    Hi,
    I am moving data from flat file to oracle table. while populating the oracle table if I get any errors in flat file those errors should populate in ODI error table.
    Is this is possible? if yes. Could you please let me know the set up in ODI.

    CKM is the dedicated for checking the constraints while doing transformation. The constraints includes, PK,FK, conditions etc.,
    There are two types/ways of checking the constraints.
    Flow Control: Triggered CKM after data is loaded in to I$.
    Static Control : Triggered CKM after data is loaded in to target table.
    If you opt for any one the above ODI will create E$ and SNP_CHECK_TAB (summary table for logging the errors) and load the error records.
    ODI will also provide you an option of loading the corrected error records by RECYCLE ERROR feature. In this phase/run ODI will load ONLY the error records in to target table (assuming its been corrected/cleaned).
    **how to set up flow control could you please provide steps**
    **Appreciate your help**

  • Error occurred moving data from the transformation RECON_SEQ_GEN: to the transformation FILTRANS.

    Hi,
    Today one my task in the DAC Etl failed and when I opened the DAC log file of it. I saw the error description as below
    Error while contacting Informatica server for getting workflow status for PLP_SRC_WH_AP_Invoice_Reconciliation
    Error Code = 36331:Unknown reason for error code 36331
    Since there is no much information in DAC log file about the failure, I opened the PLP_SRC_WH_AP_Invoice_Reconciliation session log file.
    The error description in the session log file says.
    There is an error in the port [NEXTVAL]: The default value for the port is set to: ERROR(<<Expression Error>> [ERROR]: transformation error
    ... nl:ERROR(u:'transformation error')).
    2014-01-14 08:00:45 : ERROR : (582188 | TRANSF_1_1_1) : (IS | Oracle_BI_DW_Server) : node01_ : TT_11023 : An error occurred converting data in the port [NEXTVAL]. The row was dropped.
    2014-01-14 08:00:45 : ERROR : (582188 | TRANSF_1_1_1) : (IS | Oracle_BI_DW_Server) : node01_ : TT_11021 : An error occurred moving data from the transformation RECON_SEQ_GEN: to the transformation FILTRANS.
    2014-01-14 08:00:45 : ERROR : (582188 | TRANSF_1_1_1) : (IS | Oracle_BI_DW_Server) : node01 : CMN_1086 : RECON_SEQ_GEN: Number of errors exceeded threshold [1].
    2014-01-14 08:00:45 : INFO : (582188 | TRANSF_1_1_1) : (IS | Oracle_BI_DW_Server) : node01_ : CMN_1053 : : Rowdata: ( RowType=-4(error but dropped due to abort) Src Rowid=1186281 Targ Rowid=1186281
      NEXTVAL (ROW_WID:Int:): "(NULL)"
    I am not sure of this error and I have never seen before. Can any one share some ideas on how to tackle this error and make the task execute successfully.
    Many Thanks.

    Hi,
    fist check weather any special characteristics if not
    check in data source under this we have fields tab check the format of a particular field format internal/external/check u choose internal format, if any check routine once
    use Semantic Groups in the DTP.
    Try  it
    Thanku
    lokeeshM
    Edited by: lmedaSAP_BI on Oct 20, 2010 6:44 AM

  • Adding data from a vector into a JTable

    Hi,
    I've never used JTables before, so this is all new to me. I want to display the data I have in a vector in a JTable. The little I've read about doing this involves using arrays for the JTable information, and by using that as a guide I can't get it to work. A quick answer or perhaps a link to somewhere I can read up on it would be appreciated, thanks.

    Okay, thanks for the links. I was able to set up a table, and have it display the information I want it to....sorta. The problem is, the table is only showing the first element in my vector, and nothing else. Plus, when the table starts up, it's a small box in the corner of the screen and I have to click and drag to get it visible.
    Here's a bit of my code, perhaps someone could point out what's going wrong?
    //GUI class where I call the table class from
    //all GUI and even handling stuff up here
    else if(event.getSource() == listInven){
            sim.buildtable(vec3);
    //the table class
    public class table extends JFrame {
    public Vector vec3;
        String Type;
        Vector columnNames, rowData;
        JTable table2;
        public table(){
          super("Inventory");
          Type = "Type of product";
          columnNames = new Vector(1);
          rowData = new Vector(1);
        public void buildtable(Vector vec3){
            rowData.addElement(vec3);
            columnNames.addElement(Type);
            final JTable table2 = new JTable(rowData, columnNames);
            table2.setPreferredScrollableViewportSize(new Dimension(500, 70));
            JScrollPane scrollPane = new JScrollPane(table2);
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
            setVisible(true);
       }Any help is appreciated.

  • Delete Repeated Data from an Array

    Hi guys,
    I need your support in to solve some issue with my program, I have a while loop that detects peak values from a given array of data, when I push the stop botton it records the raw file with the write to spreadsheet VI. The thing here is that when i'm collecting the peaks from the data the while loop is running and while I'm moving the position of the cursors to find out another peak that period of time generates a bunch of repeated data from the previous peak and so on until I finish collecting the peaks. What i would like to do is to collect let's say 8 peaks, and only these 8 values has to be wirtten on the text file, eliminating all the repeated vales from a single peak. Does anybody here has an idea on how to solve this problem? I really need your support!
    I'm attaching the part of the code that is doing the task, and also a sample raw file with the repeated values on it
    Thanks!
    Serge Armz
    Attachments:
    test.txt ‏1 KB
    .jpg.png ‏13 KB

    Well, I haven't bothered with an event structure, but here's a quick modification that only adds a max it it hasn't been added before.
    You still run into problems as the cursors are moved, because you might get a temporary max that is actually only the edge of a peak. I would probably add a button to manually add each valid point after the cursors have been moved to the new place.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Peak analyzer_MOD.vi ‏40 KB

  • How to  insert  300 data from associative array to backend table in PL/SQL

    HI ALL,
    I'm posting my code here:
    Creating back end table:
    Create table orlando
    ( id number(20),
    calltype number(12),
         gateway_name varchar2(25),
         accounting_id varchar2(18),
         start_time_system_ticks number(11),
         node_time_zone      varchar2(25),
         start_date varchar2(10),     
         start_time varchar2(10),
         softswitch_response number(11),
         alerting number(11)     
    Creating package:
    CREATE OR REPLACE PACKAGE r IS
    type apollo_rec is record(
    id number(20),
    calltype number(12),
         gateway_name varchar2(25),
         accounting_id varchar2(18),
         start_time_system_ticks number(11),
         node_time_zone      varchar2(25),
         start_date varchar2(10),     
         start_time varchar2(10),
         softswitch_response number(11),
         alerting number(11)
    TYPE bin_array IS TABLE OF apollo_rec INDEX BY BINARY_INTEGER;
    PROCEDURE rr (state_array bin_array);
    END ;
    SET SERVEROUT ON
    CREATE OR REPLACE PACKAGE BODY r IS
    PROCEDURE rr (state_array bin_array) IS
    BEGIN
    FOR i IN 1 .. state_array.COUNT LOOP
    INSERT INTO orlando(id,calltype,gateway_name,accounting_id,start_time_system_ticks)VALUES(state_array(i).id,state_array(i).calltype,state_array(i).gateway_name,
    state_array(i).accounting_id,state_array(i).start_time_system_ticks);
    COMMIT;
    END LOOP;
    END ;
    END ;
    I've run this code in i*SQL PLUS.But when I run this code for 5 entries there is no error but when I modify the insert statement for 300 entries(300 identifiers in the insert statement)
    it gives me error:
    Warning: Package Body created with compilation errors.
    Errors for PACKAGE BODY R:
    LINE/COL      ERROR
    7/2      PL/SQL: SQL Statement ignored
    7/14      PL/SQL: ORA-00913: too many values
    Is there any feature in PL/SQL to decrease the entries in insert statement and make the insert statement along with the program small and increase the program performance.
    Edited by: 983040 on Jan 20, 2013 11:11 PM

    Basic example (ran on 11.2.0.3):
    SQL> create table testtab( id number, day date, val varchar2(30) );
    Table created.
    SQL>
    SQL> create or replace package TestTabLib as
      2 
      3          type TTestTab is table of testtab%rowtype;
      4 
      5          procedure InsertRows( rowArray TTestTab );
      6 
      7  end;
      8  /
    Package created.
    SQL>
    SQL> create or replace package body TestTabLib as
      2 
      3          procedure InsertRows( rowArray TTestTab ) is
      4          begin
      5                  forall i in 1..rowArray.Count
      6                          insert into testtab values rowArray(i);
      7          end;
      8 
      9  end;
    10  /
    Package body created.
    SQL>
    SQL> declare
      2          rowArray        TestTabLib.TTestTab;
      3  begin
      4          --// populating the array - using a bulk fetch as
      5          --// an example
      6          select
      7                  object_id, created, object_name
      8                          bulk collect into
      9                  rowArray
    10          from    all_objects
    11          where   rownum < 11;
    12 
    13          --// bulk insert array
    14          TestTabLib.InsertRows( rowArray );
    15  end;
    16  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from testtab;
            ID DAY                 VAL
           100 2011/12/05 09:16:03 ORA$BASE
           116 2011/12/05 09:16:04 DUAL
           117 2011/12/05 09:16:04 DUAL
           280 2011/12/05 09:19:09 MAP_OBJECT
           365 2011/12/05 09:19:10 SYSTEM_PRIVILEGE_MAP
           367 2011/12/05 09:19:10 SYSTEM_PRIVILEGE_MAP
           368 2011/12/05 09:19:10 TABLE_PRIVILEGE_MAP
           370 2011/12/05 09:19:11 TABLE_PRIVILEGE_MAP
           371 2011/12/05 09:19:11 STMT_AUDIT_OPTION_MAP
           373 2011/12/05 09:19:11 STMT_AUDIT_OPTION_MAP
    10 rows selected.
    SQL>
    SQL> declare
      2          rowArray        TestTabLib.TTestTab;
      3  begin
      4          --// populating the array - using a custom build
      5          --// loop example such as a Java front-end will
      6          --// use reading data from user input form
      7          rowArray := new TestTabLib.TTestTab();
      8          rowArray.Extend(2);     --// user entered 2 values
      9          for i in 1..rowArray.Count loop
    10                  rowArray(i).id := i;
    11                  rowArray(i).day := trunc(sysdate);
    12                  rowArray(i).val := 'value '||to_char(i,'000');
    13          end loop;
    14 
    15          --// bulk insert array
    16          TestTabLib.InsertRows( rowArray );
    17  end;
    18  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from testtab where val like 'value%';
            ID DAY                 VAL
             1 2013/01/21 00:00:00 value  001
             2 2013/01/21 00:00:00 value  002
    SQL>

  • Adding data from an array to a table

    How can i add information from an array to a table via JDBC? I have tried:
    stmt.executeUpdate("INSERT INTO TEMP " + "VALUES (" + carData[0] + ", " + carData[1]);
    but i get the error:
    SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    Also, can i only add data to some columns of a row and not all?

    If your TEMP table has only two columns and both of
    them are of number
    types, and your array contains only numeric types
    (int[], long[] etc., it should not be a problem.
    If your table contains more than two columns (and the
    remaining columns are nullable) you need to list the
    column names in the insert statement. Check your table
    definition in the database and see SQL syntax for
    insert.
    If your columns are of string type, you need to
    enclose the values in quotes (alternatively, use
    PreparedStatement).I agree with this.
    Here is the syntax that he was talking about
    //if the values are numeric
    stmt.executeUpdate("INSERT INTO TEMP(<COLUMN NAME>,<COLUMN NAME>) "
    + "VALUES(" + carData[0] + "," + carData[1] + ")";
    //if the values are text
    stmt.executeUpdate("INSERT INTO TEMP(<COLUMN NAME>,<COLUMN NAME>) "
    + "VALUES('" + carData[0] + "','" + carData[1] + "')";
    Notice that the last part of your original query was incorrect. You forgot to put the bracket in quotes again.

  • Moving data from internal table to Dynamic internal table

    Hello All,
      I am facing a problem i moving the data from a internal table data to Dyn. internal table.
    My code is as follows
    *******Declartion**************************************
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
          IS_FIELDCAT LIKE LINE OF IT_FIELDCAT.
    DATA: IT_OUTTAB TYPE STANDARD TABLE OF ZVTEST.
    DATA: WA_OUTTAB TYPE  ZVTEST.
    DATA: LV_LINE LIKE SY-TABIX,
           COUNT TYPE I.
    FIELD-SYMBOLS: <NEW_TABLE> TYPE REF TO DATA.
    FIELD-SYMBOLS: <L_TABLE> TYPE ANY TABLE,
                   <L_LINE> TYPE ANY.
    FIELD-SYMBOLS: <L_FIELD> TYPE ANY.
    FIELD-SYMBOLS: <FS_DATA> TYPE REF TO DATA,
                   <FS_1> TYPE ANY TABLE,
                   <FS_2>,
                   <FS_3>.
    DATA: NEW_LINE TYPE REF TO DATA.
    DATA: LT_DATA TYPE REF TO DATA.
      ASSIGN LT_DATA TO <FS_DATA>.
    Create a new Table
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
            IT_FIELDCATALOG = IT_FIELDCAT
      IMPORTING
            EP_TABLE = <FS_DATA>
      EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          OTHERS                    = 2.
      IF SY-SUBRC = 0.
        ASSIGN <FS_DATA>->* TO <FS_1>.
        CREATE DATA NEW_LINE LIKE LINE OF <FS_1>.
    A field-symbol to access that work area
        ASSIGN NEW_LINE->*  TO <FS_2>.
      LOOP AT IT_OUTTAB INTO WA_OUTTAB.
        MOVE-CORRESPONDING WA_OUTTAB TO <FS_1>.
      ENDLoop.
    But when I am using MOVE-CORRESPONDING WA_OUTTAB TO <FS_1>.
    I am getting the error like
    "<FS_1>" is not a structure or internal table with header line.          
    Please check the code and tell where I am making the mistake.
    Regards,
    Vasanth

    Hello Rich ,
    My is code is as below..
    Declaration:
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
          IS_FIELDCAT LIKE LINE OF IT_FIELDCAT.
    DATA: BEGIN OF IT_OUTTAB OCCURS 0,
            PSPID     LIKE PROJ-PSPID, "Projektdefinition
            POSID     LIKE PRPS-POSID, "PSP-Element
            POST1     LIKE PRPS-POST1, "Kurzbeschreibung
            STTXT_INT LIKE CNJ_STAT-STTXT_INT, "Systemstatus
            STTXT_EXT LIKE CNJ_STAT-STTXT_EXT, "Anwenderstatus
          END OF IT_OUTTAB.
    DATA: WA_OUTTAB LIKE IT_OUTTAB.
    DATA: LV_LINES LIKE SY-TABIX,
           COUNT TYPE I.
    FIELD-SYMBOLS:  type any.
    DATA: NEW_LINE TYPE REF TO DATA.
    DATA: LT_DATA TYPE REF TO DATA.
      G_R_DISP_VARIANT-REPORT = SY-REPID.
      G_R_DISP_VARIANT-VARIANT = PA_VAR.
      CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
           EXPORTING
                I_DIALOG            = 'N'
                I_USER_SPECIFIC     = 'A'
                I_DEFAULT           = 'X'
                IT_DEFAULT_FIELDCAT = G_T_FIELDCAT
                I_LAYOUT            = G_R_LAYOUT
           IMPORTING
                ET_FIELDCAT         = G_T_FIELDCAT
               et_sort             = l_tab_sort
               et_filter           = l_tab_filter
               ES_LAYOUT           = G_R_LAYOUT
           CHANGING
                CS_VARIANT          = G_R_DISP_VARIANT
           EXCEPTIONS
                ERROR_MESSAGE       = 4
                OTHERS              = 4.
      LOOP AT G_T_FIELDCAT INTO G_R_FIELDCAT WHERE NO_OUT IS INITIAL
                                               AND TECH IS INITIAL.
        MOVE-CORRESPONDING G_R_FIELDCAT TO IS_FIELDCAT.
        IS_FIELDCAT-FIELDNAME = G_R_FIELDCAT-FIELDNAME.
        IS_FIELDCAT-INTTYPE   = G_R_FIELDCAT-INTTYPE.
        IS_FIELDCAT-OUTPUTLEN = G_R_FIELDCAT-OUTPUTLEN.
        IS_FIELDCAT-REF_FIELD = G_R_FIELDCAT-FIELDNAME.
        IS_FIELDCAT-REF_TABLE = G_R_FIELDCAT-REF_TABNAME.
        APPEND IS_FIELDCAT TO IT_FIELDCAT.
      ENDLOOP.
      DATA: WA_LISTE LIKE P_T_LISTE.
      CLEAR:IT_OUTTAB.
      REFRESH: IT_OUTTAB.
      LOOP AT P_T_LISTE INTO WA_LISTE.
        WA_OUTTAB-PSPID = WA_LISTE-PSPID .
        WA_OUTTAB-POSID = WA_LISTE-POSID.
        WA_OUTTAB-POST1 = WA_LISTE-POST1.
        WA_OUTTAB-STTXT_INT = WA_LISTE-STTXT_INT.
        WA_OUTTAB-STTXT_EXT = WA_LISTE-STTXT_EXT.
        APPEND WA_OUTTAB TO IT_OUTTAB.
      ENDLOOP.
    **dynamic table creation for data
      ASSIGN LT_DATA TO .
    Create a new Table
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
            IT_FIELDCATALOG = IT_FIELDCAT
      IMPORTING
            EP_TABLE = .
    A field-symbol to access that work area
        ASSIGN NEW_LINE->*  TO  = WA_OUTTAB-PSPID.
         ASSIGN COMPONENT 'POSID' OF STRUCTURE WA_OUTTAB TO <FS_3>.
          ASSIGN COMPONENT 'POSID' OF STRUCTURE  = WA_OUTTAB-POSID.
         ASSIGN COMPONENT 'POST1' OF STRUCTURE WA_OUTTAB TO <FS_3>.
          ASSIGN COMPONENT 'POST1' OF STRUCTURE .
         <FS_5> = <FS_3>.
           = WA_OUTTAB-POST1.
         ASSIGN COMPONENT 'STTXT_INT' OF STRUCTURE WA_OUTTAB TO <FS_3>.
          ASSIGN COMPONENT 'STTXT_INT' OF STRUCTURE  TO P_FILE.
        ENDLOOP.
      ELSE.
        MESSAGE E041(S9) WITH P_FILE.
      ENDIF.
      CLOSE DATASET P_FILE.
    Here my problem is ´´, I am not able to use move corresponding statement.
    So I am not getting the exact values to the fields of the dynamic table...
    Please check it and give me a solution,
    Regards,
    Vasanth

  • Explorer failed to collect data from SE6920 array

    Hi,
    Any kind soul out there can provide advice how can I collect data from SE6920 using the explorer command ?
    The man page of explorer says that to collect data from SE6920 aray, an input file "se6920inout.txt" with login info
    must be exist under the /etc/opt/SUNWexplo directory of the server connected to th array.
    However, the data collection failed while trying to retrieved from the array. The error as follow :
    Gathering data for SE6920 machine at 10.12.22.39...
    Nov 18 09:24:12 sslab-79[25355] se6920: ERROR Data collection for 10.12.22.39 failed because the /tmp directory is either 100 percent full,
    patch 114591-22 or higher is not installed on the SP, or fix for BugID 6448763 has not yet been implemented.
    Thanks very much reading this message.

    If all of the files are in the same folder you can use List Folder to list all of the files based on a pattern. You can then use this to auto-index a for loop.

Maybe you are looking for

  • MR8M-Document already contains cleared items - reversal not possible

    Hi Gurus, I am getting error message Document XXXXX 1000 2014 already contains cleared items - reversal not possible while cancelling IR via Tcode MR8M. Invoice was already paid twice by mistake hence we are trying to cancel via MR8M. I know we can d

  • Change Mailbox Behavior - Can it be changed back to default?

    I mistakenly changed the setting and want to change it back to default, i.e. keep sent box on the server rather than on my iPhone. Is it possible? If not, does not mean the messages in my sent box will stay on my server AS WELL AS on my iPhone? Thank

  • Itunes downloaded movie won't run anymore

    I upgraded my Macbook from Leopard to Mountain Lion and then upgraded iTunes.  Now when I download a movie off of the iTunes store and try and play it, the error message comes up that says:  This movie requires QuickTime, which is not supported by th

  • Agent resident memory utilization and Agent Virtual Memory Growth is HIGH

    I have been receiving many alerts from EM on agents resident memory and virtual memory growth is high. Every time the agent is getting restarted by watchdog. I am wondering where exactly the problem is ...! anil

  • Laptop not booting after recent Security patch -  fixed

    I couldn't get me Mac to boot unless in Safe Mode.. After trying all kinds of things like zapping PRAM and deleting Caches, what finally did the trick was one of two things... I turned off the ADOBE Version CUE from start up items. (I was also runnin