How to transpose the data records (rows) to column(lists) using apd

Hi,
  how to transpose the data records (rows) to column (lists) using apd  in sap bw.
I do not want to use abap routine.only use the transpose rows to list  transformation .
Pls provide the step by step procedure .
thanks,
Nimai

Save youe file to transpose as a csv and in the header row of your file for the columns you want to transpose you need to put some soer of a tag before the column name (ie your colum header was for a period budget will be something lie 2011001:ZFIBDD)
1. You will need to create a new apd process (rsanwb)
2. Insert a "Read from Data File" data source object and map it file (,csv)
3. insert a transpose object into your apd process (middle row 4th one over in the transformations section)
4. under the definition tab in the transformation object select all the columns that are to be transposed into rows and move them to the transformed area, the grouping fields section should contain the rows that you want to now be columns
5.under the transformation tab enter in the seperator you selected  under the Field Name/Infoobject area (ie. ZFIBDD)
6. under the details tab  you need to enter in all the fields to be transformed and tner the transposition field (ie ZFIBDD)
7. Then you can insert a set of transformations and a DSO and link the newly transposed fields into that.
hope that helps

Similar Messages

  • How to see the data records for a dso based upon the request id?

    Hi all,
    How to see the data records based upon the request id on the dso.
    I need to see the data for a dso based upon the request id 444493 loaded from another dso through repair full update.
    thanks

    Hi,
    Step 1: select your request from DSO request tb
    Step 2: Select your DSO just above your contents/requests/reconstruction tabs
    Step 3: Click contents(Spectacles symbol) in the top area of your screen
    Step 4: Slect the required fields
    Regards,
    Suman

  • How to find the Data Type of a column

    Dear All,
    How to find the Data Type of a Column dynamically in oracle Form.
    Thanks and Regards,
    Fazil
    Edited by: user11334489 on Aug 25, 2012 9:06 PM

    hi,
    you can use get_item_property built-in
    eg:
    declare
       l_item VARCHAR2(10);
    begin
       l_item := Get_Item_Property('item_name',DATATYPE);
    end;

  • How to display the data in row wise in smartform

    Hi,
        I have to make a modification a smartform of poprinting and i want to display the row wise . At present it is displaying the  
        column wise. Actually there is a text which i want to display the data row wise.
        It is possible to display the data in row wise of the text .
    Edited by: nav009 on Oct 8, 2009 10:39 AM

    Hello ,
    I  assume that your requiremen is related to smartform.the below is the solution i suggest.
    As per my understanding of your requirement ,It's clear that as of now there is some description field which is also getting displayed along with other PO fields.
    However you would like to display the description field in a new line since the length of this field is longer than other fields as a result the data is getting scattered .
    Therefore one better option could be: since the whole data from PO would be in a loop you can display all other fields in one line type of the table as per the intial requirement and you display the description line alone in a new line type wth the desired length so that data would not be scattered and no data loss would happen.
    I assume you are aware of creating of line types for table.
    Thanks
    M.Naveen.

  • How to get the Data Record Number in BI 7.0?

    Hi All,
    In our requirement we need to load the Data Record Number in the DSO. I got the Request ID and Data Packet Number but not the Data Record Number.
    Does anyone has any idea?

    Hi......
    When the data is activated in DSO, it is written to the table of active data, where it is then available for reporting. Requests are sorted by the key of the DataStore object, request ID, data package ID, or data record number.
    You just load the data to the DSO.....and activate it.......it will autometically get generated.......You cannot load it from one DSO to other beacuse in this case Change log table is used........and this filed is in active table..........I think you need this fir reporting purpose.....so load it and activate the DSO......then it will be available in your active table for reporting.........because reporting is done on active table.......
    Check this link :
    http://help.sap.com/saphelp_nw04s/helpdata/en/a9/49453cabf4ef6fe10000000a114084/frameset.htm
    Hope this helps you....
    Regards,
    Debjani....
    Edited by: Debjani  Mukherjee on Sep 16, 2008 5:22 PM
    Edited by: Debjani  Mukherjee on Sep 16, 2008 5:25 PM

  • How to display the data in XML files into JSP using Jdeveloper.

    Hi All,
    I have two XML files one XML file has the view names and the other has the table names of a particular views, how to display the data in JSP using JDeveloper where when i click a particular view the list of tables of that particular view from XML file two should be displayed in JSP Page.
    Are there any reference documents, regarding the above process please can anyone guide through how to do it.

    Let the servlet ask your business tier to provide the data, then stuff it into beans, and pack those into the Session instance. Then forward the request to the JSP, let the JSP get those beans and display them.

  • How to split the data based on one column

    Dear All,
    I have the table data like this.
    type quantity revenue_mny count country
    a 10           10          2 India
    a 20          12          3 India
    b 30          15          1 India
    a 35          20          2 US
    b 20          10          1 US
    b 60          15          1 US
    I woulkd like to split the date based on type column.
    For each country, for Type "a" get the sum of revenue count quanity ans same for b
    and all shuld come in on row for each country.
    output should be like
    country revenue_mny(For a) quantity(for a) count(For a) revenue_mny(for b) quantity(for b) count(For b)
    India 22 30 5 15 30 1
    US 20 35 2 25 80 2
    I tried the below query . its not splittng the date for each country in one row.
    select country,
    sum(case when type='a') then revenue_mny else 0 end ) revenue_mny_a,
    sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b
    sum(case when type='a' then quantity else 0 end) quantity_a,
    sum(case when type='b' then quantity else 0 end) quantity_b from
    test
    group by country
    Please need your helo

    Like this?
    with t as
    select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
    select 'a', 20, 12, 3, 'India' from dual union all
    select 'b', 30, 15, 1, 'India' from dual union all
    select 'a', 35, 20, 2, 'US' from dual union all
    select 'b', 20, 10, 1, 'US' from dual union all
    select 'b', 60, 15, 1, 'US' from dual
    select country,
    sum(case when type='a' then revenue_mny else 0 end ) revenue_mny_a,
    sum(case when type='a' then quantity else 0 end) quantity_a,
    sum(case when type='a' then cnt else 0 end) cnt_a,
    sum(case when type='b' then revenue_mny else 0 end ) revenue_mny_b,
    sum(case when type='b' then quantity else 0 end) quantity_b ,
    sum(case when type='b' then cnt else 0 end) cnt_b
    from t
    group by country;result:
    COUNTRY  REVENUE_MNY_A QUANTITY_A CNT_A REVENUE_MNY_B QUANTITY_B CNT_B
    India    22            30         5     15            30         1
    US       20            35         2     25            80         2Or you can do it with a decode instead of case. The result will be the same:
    with t as
    select 'a' type, 10 quantity, 10 revenue_mny, 2 cnt, 'India' country from dual union all
    select 'a', 20, 12, 3, 'India' from dual union all
    select 'b', 30, 15, 1, 'India' from dual union all
    select 'a', 35, 20, 2, 'US' from dual union all
    select 'b', 20, 10, 1, 'US' from dual union all
    select 'b', 60, 15, 1, 'US' from dual
    select country,
    sum(decode(type,'a',revenue_mny,0)) revenue_mny_a,
    sum(decode(type,'a',quantity,0)) quantity_a,
    sum(decode(type,'a',cnt,0)) cnt_a,
    sum(decode(type,'b',revenue_mny,0)) revenue_mny_b,
    sum(decode(type,'b',quantity,0)) quantity_b,
    sum(decode(type,'b',cnt,0)) cnt_b
    from t
    group by country;(I changed tablename from TEST to T and columnname from COUNT to CNT, because you should not use reserved words as tablename or columnname.)
    Edited by: hm on 09.10.2012 06:17

  • How to delete the data loaded into MySQL target table using Scripts

    Hi Experts
    I created a Job with a validation transformation. If the Validation was failed the data passed the validation will be loaded into Pass table and the data failed will be loaded into failed table.
    My requirement was if the data was loaded into Failed database table then i have to delete the data loaded into the Passed table using Script.
    But in the script i have written the code as
    sql('database','delete from <tablename>');
    but as it is an SQL Query execution it is rising exception for the query.
    How can i delete the data loaded into MySQL Target table using scripts.
    Please guide me for this error
    Thanks in Advance
    PrasannaKumar

    Hi Dirk Venken
    I got the Solution, the mistake i did was the query is not correct regarding MySQL.
    sql('MySQL', 'truncate world.customer_salesfact_details')
    error query
    sql('MySQL', 'delete table world.customer_salesfact_details')
    Thanks for your concern
    PrasannaKumar

  • How to retrieve the data type of a column of a table?

    Hi,
    I want to retrieve the data type of a column of a table. At the moment I am querying "OCI_ATTR_DATA_TYPE" attribute but it is returning SQLT_CHR for both varchar2 and nvarchar2 data type columns. I need to distinguish between these two data types columns separately. Is there any API through which I could get the exact data type of a column i.e. "nvarchar2"?
    Thanks in advance.
    Hashim

    Hi,
    This is the Oracle C++ Call Interface (OCCI) forum - I'm not sure if you are using OCCI or OCI (Oracle Call Interface - the C interface) since you reference "OCI_ATTR_DATA_TYPE" which is more of an OCI focus than OCCI.
    In any case, you might take a look at "OCI_ATTR_CHARSET_FORM" which takes the following values:
    #define SQLCS_IMPLICIT 1     /* for CHAR, VARCHAR2, CLOB w/o a specified set */
    #define SQLCS_NCHAR    2                  /* for NCHAR, NCHAR VARYING, NCLOB */So, if you have a datatype of SQLT_CHR and OCI_ATTR_CHARSET_FORM is SQLCS_IMPLICIT then you have a varchar2 if it is SQLCS_NCHAR then you have an nvarchar2.
    If you are using OCCI and not OCI then take a look at MetaData::ATTR_DATA_TYPE and MetaData::ATTR_CHARSET_FORM which expose OCI_ATTR_DATA_TYPE and OCI_ATTR_CHARSET_FORM respectively.
    Perhaps that will get you what you want.
    Regards,
    Mark

  • How to fetch the data records in summary format based on previous day

    drop table T1;
    create table T1(Class, Fees_Collected, Submit_Date) as select
    'MBA', 100000, '7/30/2012' from dual union all select
    'Btech', 20000, '7/10/2012' from DUAL union all select
    'MBA', 45000, '8/1/2012' from dual union all select
    'Btech', 55550, '7/31/2012' from DUAL union all select
    'BBA', 250660, '7/30/2012' from dual union all select
    'MBBS', 44556000, '7/31/2012' from DUAL union all select
    'BDS', 420050, '8/1/2012' from DUAL union all select
    'BBA', 30450, '7/30/2012' from DUAL union all select
    'MBBS', 120450, '7/31/2012' from DUAL union all select
    'BDS', 45950, '7/30/2012' from DUAL union all select
    'MBA', 252450, '8/1/2012' from DUAL;My requirment is to fetch the records based on summary format to display the data with following columns -
    Class |Prev Day Traded Value |Prev Day % of Total |Prev Day % MBA
    Note - Previous Day definiton (Buisness Day) = calendar days - (weekends + US Holidays)
    Kindly help me, as i want to keep it customized so that without specifying the hard coded dates ( Previous Day) it runs through and provide me the resultset....
    All of your help and time is highly appericated.

    You mean business days I guess ?
    I use a function (I had to write it myself) <tt><b> next_business_day(p_start_date in date,p_days_count in number) return date </b></tt>
    where I loop forward/backward from p_start_date according to the sign of p_days_count the required number of steps skipping weekends and holidays as the absolute value of p_days_count is mostly under 30 for the rest (at least around here) Oracle's <tt><b> add_months </b></tt> gets it done.
    Regards
    Etbin
    Edited by: Etbin on 6.8.2012 17:55
    Year till date: <tt><b> your_date between trunc(sysdate,'year') and sysdate </b></tt> is it ? http://en.wikipedia.org/wiki/Year-to-date ?
    Edited by: Etbin on 6.8.2012 18:27
    NOT TESTED!
    function next_business_date(p_start_date in date,p_count_days in number) return date is
      steps  number := abs(p_count_days);
      retval date := p_start_date;
    begin
      if p_start_date is null or p_count_days is null then
        return to_date(null);
      end if;
      while steps > 0
      loop
    /* skipping weekends and (yet to be implemented) holidays */
        while to_char(retval,'dy') in ('sat','sun') /* or is_holiday(retval) */
        loop
          retval = retval + sign(p_count_days);
        end loop;
    /* retval contains a business day now */
        retval = retval + sign(p_count_days);
        step := step - 1;
      end_loop
      return retval;
    end;

  • Transposing Table Data From Rows to Columns Into a View

    I have a web-based HRMS (Human Resources Management System) ERP with a back-end SQL Server 2008 R2. I'm trying to compare the actual manpower with the manpower contract requirements for 30 cost centers. My base data is as follows:
    TABLE Contract_Requirements: Class, Cost_Center, Contract_Qty
    VIEW Manpower_Count: Class, Cost_Center, Head_Count
    I would like to transpose the rows to columns of both objects so that the end result would be similar to the following:
              Class          |          Site_1          |         
    Site_2          |          Site_3          |          Site_4         
    |...
    Superintendent                   1                              
    1                             1                            
    1
    Supervisor                           2                              
    2                             2                            
    2
    Medic                                   1                              
    2                             1                            
    3
    Crane Operator                   1                              
    1                             2                            
    1
    The target layout is that each individual record displays the number of employees of a specific class allocated to each individual cost center; the cost centers become columns. I was able to accomplish this using the following TSQL:
    DECLARE @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX)
    SELECT @cols = STUFF((SELECT ',' + QUOTENAME(Cost_Center)
    FROM Manpower_Count
    GROUP BY Cost_Center
    ORDER BY Cost_Center
    FOR XML PATH(''), TYPE
    ).value('.', 'NVARCHAR(MAX)'),1,1,'')
    SET @query = 'SELECT Class,' + @cols + ' INTO
    Manpower_Allocation_Matrix FROM
    (SELECT Class, Cost_Center, Head_Count
    FROM Manpower_Count) x
    PIVOT (SUM(Head_Count) FOR Cost_Center IN (' + @cols + '))p'
    EXECUTE(@query);
    The only problem is if an employee is transferred from one cost center to another, which happens a lot on a daily basis, this would only be reflected in the base view; the resultant table will not be updated. I would have to repeatedly drop and recreate
    the table which isn't efficient, nor is it the right practice. I was thinking of automating this using a scheduled procedure every day, but it's still not going to work. The actual manpower count must be known at real-time, meaning any changes should be reflected
    immediately after any employee transfer. What is the most efficient way to automate this process and store real-time data? FYI, I'm not an SQL expert and have never worked with
    stored procedures or triggers. I would also like to point out the number of cost centers is never fixed; consequently the number of columns aren't fixed either.

    Hi Seif,
    You can pivot straightly on the base view to get real time data. The dynamic PIVOT is encapsuled in a Stored Procedure(SP), so every time your want to check the manpower count you can call the SP.
    --This table is the same with your base view
    CREATE TABLE srcTbl(
    Employee_Code VARCHAR(99),
    Employee_Name VARCHAR(99),
    Cost_Center_name VARCHAR(99),
    Cost_Center_NO VARCHAR(99),
    Position_ VARCHAR(99),
    Total_Salary Money
    INSERT INTO srcTbl VALUES('CAN-010','John Doe A','Site 120',120,'Fork Lift Operator',150);
    INSERT INTO srcTbl VALUES('EGY-130','John Doe B','Site 150',150,'Driver',200);
    INSERT INTO srcTbl VALUES('IND-120','John Doe C','Site 113',113,'Fork Lift Operator',150);
    INSERT INTO srcTbl VALUES('SAU-50','John Doe D','Site 112',112,'Mechanic',261.948);
    INSERT INTO srcTbl VALUES('PHI-90','John Doe F','Site 112',112,'Crane Operator',250);
    INSERT INTO srcTbl VALUES('CAN-012','John Doe G','Site 120',120,'Driver',200);
    INSERT INTO srcTbl VALUES('IND-129','John Doe I','Site 150',150,'Superintendent',2300);
    INSERT INTO srcTbl VALUES('PAK-464','John Doe X','Site 141',141,'Supervisor',1800);
    INSERT INTO srcTbl VALUES('FRA-003','John Doe M','Site 120',120,'Medic',700);
    GO
    CREATE PROC proc1
    AS
    DECLARE @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX)
    SELECT @cols = STUFF((SELECT ',' + QUOTENAME(Cost_Center_no)
    FROM srcTbl
    GROUP BY Cost_Center_no
    ORDER BY Cost_Center_no
    FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)'),1,1,'')
    SET @query=N';WITH Cte AS(
    SELECT Position_ as Class,Cost_Center_No, COUNT(1) AS Head_Count FROM srcTbl
    GROUP BY Position_,Cost_Center_No
    SELECT Class,'+@cols+'
    FROM Cte
    PIVOT
    (MAX(Head_Count) FOR Cost_Center_No IN('+@cols+')) AS PvtTbl
    ORDER BY Class';
    EXEC sp_executesql @query ;
    GO
    EXEC PROC1
    DROP PROC PROC1
    DROP TABLE srcTbl
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to populate the last empty row in Excel without using Report Generation Kit

    I wrote  a Labview SUb Vi that uses Report Generation Toolkit that is not loaded on the test stand. I am looking to convert it from Report Generation Vi like New Report,  Append Table to Report, Dispose Report. The tunneling through all the report generation Vis seems extensive. Code is attached. Thanks, Greg
    Greg

    Thank you that was a big help...
    I used the Excel Forum to get a lot of great ideas.  My code is almost working.
    There is a 2-D String Array that represents the String data that I am exporting to the Excel File Sheet 1 - 5.
    I am attempting to determine the last populated row in sheet 1 then populate the next row of Sheet 1.  Since all 5 sheets are populated every time, I should not have to search every sheet for the last row.
    I am getting two row populated on sheet 1 with seeming the same data.
     I found an AXExcelWrite2D ArrayWorksheet.vi that I thought would work.  I think there is a Table  determination that is causing me problems.  The link is http://lavag.org/topic/13324-labview-and-excel-activex-or-ado/.  The Application Invoke Node has a convert formula with "FromReferenceStyle" with R1C1 Attached to it.   I am not sure what this function is doing.  When I try to bring the function help up, there is a missing file.
    I am including both the new active x vi and the report generation vi.   Report Generation VI works.
    I would appreciate any assistance I can get on this.
    Thanks
    Greg
    Greg
    Attachments:
    REPU Test Data Population using Active X Write Save.vi ‏92 KB
    REPU Test Data Population.vi ‏60 KB

  • How to duplicate the data in matrix single column........

    hi all,
              In my addon-form i have a matrix,in the matrix i have data for 5 rows....in that 3rd column when i enter any number & press tab key....the remaining 5 rows(downwards only) for that 3rd column only should be get updated with that number...can anybody suggest me some ideas????
    example:-
    custcode     custname    days
    =======    =======    ===
    10001          John           3
    10002          Peter          8
    10003          David          5 -
    >here when i type 5 & press tab   remining rows for that column should get updated with no:5
    10004          Kris          
    10005          Corter
    10006          Albert
    regards,
    shangai.

    Hi...
    use this code
    menu event
    If (pVal.MenuUID = "Duplicate") And (pVal.BeforeAction = False) Then
    Try
    Dim oDBDataSource As SAPbouiCOM.DBDataSource
    Dim s As Integer = 0
    Dim omat1 As SAPbouiCOM.Matrix
    Dim newrowid As Integer = 0
    omat1 = RFrm.Items.Item("5").Specific
    For s = 1 To omat1.RowCount
    If omat1.IsRowSelected(s) Then
    Try
    omat1.GetLineData(s)
    newrowid = s + 1
    omat1.AddRow(1, newrowid)
    omat1.SetLineData(newrowid)
    Catch ex As Exception
    SBO_Application.MessageBox(ex.Message)
    End Try
    End If
    Next
    For i = 1 To omat1.RowCount
    oedit1 = omat1.Columns.Item("0").Cells.Item(i).Specific
    oedit1.Value = i
    Next
    Catch ex As Exception
    SBO_Application.MessageBox(ex.Message)
    End Try
    End If
    Right Click Event
    If eventInfo.FormUID = "Routing" Then
    If (eventInfo.BeforeAction = True) Then
    Dim oMenuItem As SAPbouiCOM.MenuItem
    Dim oMenus As SAPbouiCOM.Menus
    omat1 = RFrm.Items.Item("5").Specific
    GCols = omat1.Columns
    Try
    selItem = eventInfo.ItemUID
    Dim oCreationPackage As SAPbouiCOM.MenuCreationParams
    oCreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
    oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
    oCreationPackage.UniqueID = "Duplicate"
    oCreationPackage.String = "Duplicate Row"
    oCreationPackage.Enabled = True
    oMenuItem = SBO_Application.Menus.Item("1280")
    oMenus = oMenuItem.SubMenus
    oMenus.AddEx(oCreationPackage)
    Catch ex As Exception
    SBO_Application.MessageBox(ex.Message)
    End Try
    Else
    Dim oMenuItem As SAPbouiCOM.MenuItem
    Dim oMenus As SAPbouiCOM.Menus
    Try
    SBO_Application.Menus.RemoveEx("Duplicate")
    Catch ex As Exception
    MessageBox.Show(ex.Message)
    End Try
    End If
    End If
    It will work...
    Regards...
    Billa 2007

  • How to show the data of one query since Forms9i using to Report built-in on

    Hello!!!, I have Developer 9i (Forms and Reports), the OCJ4 and repserver90 are running, now, I attempt to run one report from Forms9i, and only it appears an empty page HTML. I don't understand why doesn't show the data of query?
    Please, give me a solution for this problem, thanks for your help.
    PD: I am using the below code.......
    PROCEDURE bring_report IS
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := find_report_object('Q_DATA1');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'repserver90');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://172.16.2.18:8888/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    END;

    Alex,
    the code does look good. maybe the Reports query does not produce an output. You can trace this ny adding a header on top of teh Reports (e.g. a date or just saying "Hello World"). So instead of an empty page this should now show the text strings. If you don't see the string then there is something else going on. Since you are not getting any error message I assume that the Reports itself executes fine.
    Frank

  • How to get the data type of a column?

    I plan to construct a dynamic insert statement, so the column's type is needed, any possible to get what type of a column within mysql's table?
    Message was edited by:
    ioiioi

    Think about it this way
    You can find out the type of the columns but can you convert the data items that you have to insert in to the table in to the proper column type. And you will also have to write a long if-else-if if you try to do this.
    Just make the JDBC driver worry about this.
    Try something like this.
    public void insert(String table, Object data[]){
       //You should write the getNumCollumns method
       //to return the number of columns in the table
       // Using Matadata Objects
       int noOfColumns = getNumCollumns(table);
       if (noOfColumns  != data.length)
          throw new IncorrectNumberOfValuesException();
       //You should write this exception probably to be a subclass of SQLException
       //Now construct the insert statement
       StringBuffer sb = new StringBuffer("INSERT INTO ");
       sb.append(table);
       sb.append(" VALUES (");
       for (int i=0; i<noOfColumns ; i++){
          sb.append("?");
          if (i< (noOfColumns-1))
             sb.append(",");
       sb.append(")");
      //If you want you can cache the statement againt the table name
      //Now create your prepared statement
      PreparedStatement ps = connection.prepareStatement(sb.toString());
      //Set the data
      for (int i=0; i<data.length; i++){
          ps.setObject(i+1, data);
    //Execute
    ps.executeUpdate();
    ps.close();
    In the above code the caller is responsible for sending the data with proper java type to be inserted and the driver will do the conversion. I have used this approach in a project few years ago and I havent got any complains.
    WARNING: I havent compiled above code. It may have typos

Maybe you are looking for