Creating Table Data in Java

Hi All,
there are some examples "Creating Table Data in Java" in the Oracle ADF UIX Developer's Guide Chapter 9 - Creating Tables in ADF UIX.
Especially the directory listing is interesting. It works fine in my testproject.
But how can I pass parameters to this class dynamically. (e.g. path of the directory). If I add a new parameter to the method
public static DataObject getDirectoryData(RenderingContext context,String namespace, String name, String myPara)
I get the following error message:
Warning(124,58): test.uix: Parsing error, line 124, column 58: Could not find method getDirectoryData in test.MyTable:Method getDirectoryData does not have the correct signature.
Thanks for any tips or idea
Roger

Thank you for answering.
May I use this example in a data provider with a dynamic variable for the path?
If I use my own class inside an INVOKE element the problem is as follows: I'm not able to format the return stream. It contains a StringArray.
In a servlet I can use the following simple syntax for a HTML choicebox:
-------------------snipp-----------------------------------
buffer = buffer + "<select name=\"p_file\" size=\"1\">";
for (int i=0 ;i<p_length ; i++ ) {
buffer = buffer + "<option value=\"" +lines[i]+"\">" + lines;
buffer = buffer + "</select>";
-------------------snapp-----------------------------------
I don't find a solution to use a for-loop in uix. The JSTL syntax doesn't work there.
Any ideas?
THX Roger

Similar Messages

  • Create table dinamically using java sql types?

    Hi! I've an application that reads an XML file. This file contains de definitions of some tables, using java sql types. For example:
    <dbtable>
      <dbtablename>Name of table</dbtablename>
      <dbtablefield>
        <name>Name of table field</name>
        <type>java.sql.Types.VARCHAR</type>
        <length>10</lenght>
        <canNull>0</canNull>
        <isPK>1</isPK>
      </dbtablefield>
    </dbtable>That's a little example of one table, with one field. Is a java.sql.Types.VARCHAR (or is equivalent in int), which has a size of 10, it cannot be null and is a primary key for the table.
    Now, the lenght, null, and primary keys are not problem at all. What I want to know, is how do I create de table using the java.sql.Types. I mean, I don't want to hard code:
    String s = "CREATE TABLE name (COLUMN VARCHAR(10)...";Instead, I want to use some "wild cards", as are used in PreparedStatement. The idea of this is that no matter what DB I'm using, I must always be capable of creating the tables not worrying for the DB. I mean, I must be able to create the table in Oracle, SQL Server, DB2, etc., using the same XML and the same java class.
    Something like:
    String s = "CREATE TABLE name (COLUMN ? (10)...";
    someobject.setObject(1,java.sql.Types.VARCHAR);
    someobject.execute(); //create tableIs this possible? Or do I have to make a map for each DB?
    Thanks a lot for your help! Dukes available!

    you can provide some fields at runtime..
    for example
    "CREATE TABLE name (COLUMN" + arg[1] +"(10)..."
    here arg is the string array passed into the main.

  • Export and import table data with Java

    I need a library for simple exporting and importing table data.
    The data should be exported to a SQL file with insert statements.
    I just want to tell the library the table name, the connection and where to store the file. The usage should be very simple.
    Are there any small libraries for this? Finished calsses and methods which I can just call?

    I need a library for simple exporting and importing
    table data.
    The data should be exported to a SQL file with insert
    statements.Every database has utilities to export/import data from tables. Take a look at your database manual.

  • Create Table query in java for oracle

    hi all,
    i am working on a project in which i have to create table runtime, i want that if table already created it dont create.
    Regards

    There is a forum for JDBC related questions. This is not that forum. Also you may have noticed that there is no forum called "General Oracle PSQL questions here" amongst these forums as well and that might be something you wish to reflect upon.

  • Creating table data from multiple tables

    I want to be able to create a extract file  of the data in the BKPF and BSEG tables. I need to create one line that contains a combination of fields from each table. I am thinking that I have to select the data that I need from the BKPF table into a work table and select the data that I need from the BSEG using the document number field from the BKPF as part of the selection into another work table. after I get the two work tables, I am going to have to read the BKPF table and move the fileds that I want to a third table and then read every entry in the bseg work table that matches the document number and move those field to the third work table. after that is completed, I will a one table that has data from both tables. is this the correct way to handle this. if there is a easier way to perform this operation, could someone please let me know
    thanks in advance for the help.

    Hi Timothy,
    this would suffice.
    data: itab like bkpf occurs 0 with header line.
    data: itab1 like bseg occurs o with header line.
      SELECT * FROM BKPF INTO TABLE itab
                   WHERE BUKRS EQ P_BUKRS AND
                         BELNR IN S_BELNR AND
                         GJAHR IN S_GJAHR.
      SELECT * FROM BSEG INTO TABLE ITAB1
              FOR ALL ENTRIES IN ITAB
                        WHERE BUKRS eq ITAB-BUKRS
                        AND BELNR eq ITAB-BELNR
                        AND GJAHR eq ITAB-GJAHR.
    Regards,
    Vivek

  • How can I create tables (data dictionary) on SAP Environment in BATCH mode?

    I need a Help on Table Creation on SAP in Batch Mode. I don't want to use SE11 and manually enter all 2000 table definition in the Front END. Is there any way where I can create a tables on SAP in Batch MODE. I want to create around 2000 tables, where schema is generated from external source.  As we know table created from Native SQL will not be available in SAP Application Layer.

    Hi Kenneth,
    Which version are you in? I'm on 4.7 and i have the class on my system.
    You may even try using the Function module that i had mentioned in my earlier post. That might solve your problem.
    Please write back if you problems decides to have a date with you.
    Thanks, Debasish

  • RE:Creating  Table in Webdynpro Java

    Dear all,
    We are creating a medical claim in which we have to enter multiple values as input into a table.We have created a function module and imported  into model,binding to context is done .
    We are have to things in the application
    1.cltyp(dropdown box)
    2. Table
    i am writing  the following code to initilize the dropdown as
    input.setCltyp(wdContext.currentZhrg_Ep_Med_InputElement().getCltyp());
    but when we are trying to initilize the table its giving as error.
    we are not able to give inputs as the table is in disable mode.
    Please treat as Urget and reply asap
    ravi.s

    hi Ravi,
    I was faced the same problem previously, the solution for this problem is
    1. first check the Cardinality of context binding
    2. and then check the Object intialization(like create object for that particular BAPI elements(root nodes and sub nodes) in COmponent controller init() mentod)
      for Example find out the below code:
       "   Bapi_Catimesheetmgr_Insert_Input in = new  Bapi_Catimesheetmgr_Insert_Input();
    wdContext.nodeBapi_Catimesheetmgr_Insert_Input().bind(in);
    in.addCatsrecords_In(new Bapicats1());  "
    in the above code
    Bapi_Catimesheetmgr_Insert_Input  is root node and sub node is "Catsrecords_In is a sructure for the Bapicats1".
    then only ur table will be in enable mode.
    try above code once using ur BAPIs
    I hope it will helpful to u
    "Please award points for helpful answers"
    Thanks
    Anu

  • How create table with variable number of columns?

    I am creating table data in Java. Number of columns is variable. How I can write <table> in UIX.
    Here is code of one of my unsuccessful attempt:
    <provider>
    <!- get table data like DataObjectList-->
    <data name="ReportTableData">
    <method class="app.ReportTableData" method="getTableData"/>
    </data>
    <!- get names of columns like DataObjectList-->
    <data name="ColumnNames">
    <method class="app.ReportTableData" method="getColumnNames"/>
    </data>
    </provider>
    <table data:tableData="@ReportTableData">
    <contents data:childData="@ColumnNames">
    <text data:text="nameColumn"/>
    </contents>
    </table>
    I hoped that I can get cell data by key, where key is name of column. But cells of table contain only names of columns.
    Please help me, where I mistaken?
    Thank you.

    Hi Sergey,
    The UIX table implementation relies on a childData like mechanism internally to iterate over the rows. For instance, when you databind the text attribute of the UINode used to stamp out each column, you are relying on the uix:table iterating over the table data using the data object for the current row when evaluating your column stamp.
    Setting the data:childData attribute on the table's contents element conflicts with UIX's internal iteration over the tableData. For this reason, we don't support specifying a dynamic number of table columns in UIX XML.
    This doesn't mean that you can't do it, there are different strategies. If you've got a finite and known set of columns, you can specify each possible column and then databind the rendered attribute of each one to hide and show it as appropriate. Another, often cleaner approach, is to build this subtree of UINodes in Java code.

  • How to create table in interactive form via Java Web Dynpro

    Hi,
    How to create table in interactive form via Java Web Dynpro ?
    Any online tutorial / example ?
    Thank you.
    Regards,
    Eric

    Hi Eric,
    Just choose the UI element Table from Form Library and drag and drop it on the form. now choose the no. of rows and columns and other settings you want about table from the wizard initiated through this process. This all is what you have to do to create the table. Now to bind it to the fields of the data source bind the individual colums to individual attributes of the node in the datasource.
    Hope it will solve your query.
    Regards,
    Vaibhav Tiwari.

  • Mapping of PLSQL  table type  Date to java

    i am having problem in mapping plsql table type DATE in java,
    able to execute procedures which return plsql table type NUMBER,VARCHAR.
    i am using oracle 9 , jdk1.4, oci driver, windows 2000.
    sample code:
    registering:
    st.registerIndexTableOutParameter(15,100,OracleTypes.DATE,1000);
    st.registerIndexTableOutParameter(16,100,OracleTypes.DATE,1000);
    st.execute();
    getting out params in arrays:
    java.sql.Date[] O_lSubFolder_CrOn=(java.sql.Date[])java.sql.Date[] st.getPlsqlIndexTable(15);
    O_lSubFolder_MdOn=(java.sql.Date[])st.getPlsqlIndexTable(16);
    error while executing the code:
    java.sql.SQLException: Invalid PL/SQL Index Table element type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:285)
    at oracle.jdbc.driver.OraclePreparedStatement.checkPlsqlIndexTableBindTypes(OraclePreparedSt
    atement.java:2705)
    at oracle.jdbc.driver.OracleCallableStatement.registerIndexTableOutParameter(OracleCallableS
    tatement.java:834)
    can anyone help me to solve this problem.

    i am having problem in mapping plsql table type
    DATE in java,
    able to execute procedures which return plsql table
    type NUMBER,VARCHAR.
    i am using oracle 9 , jdk1.4, oci driver, windows
    2000.
    sample code:
    registering:
    st.registerIndexTableOutParameter(15,100,OracleTypes.D
    TE,1000);
    st.registerIndexTableOutParameter(16,100,OracleTypes.D
    TE,1000);
    st.execute();
    getting out params in arrays:
    java.sql.Date[]
    O_lSubFolder_CrOn=(java.sql.Date[])java.sql.Date[]
    st.getPlsqlIndexTable(15);
    O_lSubFolder_MdOn=(java.sql.Date[])st.getPlsqlIndexTab
    e(16);
    can anyone help me to solve this problem.1. Write a wrapper procedure that converts the table of dates to either number or date and then re-convert the table back into date.
    2. Since it's an out param you could create a temp table, insert the contents of the index by array into it and return a cursor.
    3. Create a oracle type using CREATE TYPE and then use an array of the type.
    David Rolfe
    Orinda Software

  • Binding and displaying data to table in webdynpro java

    hi all,
    i want to know how to bind the output values to table in webdynpro java.
    i know how to bind values in context to table,but if we want to display the values from database(back end ) and display in table present in the view.
    eg: i have table in view and want to get values from backend(SQL server) and display it in that table.
    plz help me to know ..
    thanks
    sirisha

    Hi Saisirisha,
    Try this.
    1> Take a Value Node(Employee) cardinality 0..n.
    Employee Structure
    Employee
    |------Surname(Attribute)
    |------FirstName(Attribute)
    |------Category(Attribute)
    2> Bind this value node(Employee) in the View datasource of table.
    3> Try the code inside wdDoInit method.
    try {
         // Load the JDBC-ODBC bridge
         Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
         // specify the ODBC data source's URL
         String url = "jdbc:odbc:SSPer";
         // connect
         Connection con = DriverManager.getConnection(url,"North","Ken");
         // create and execute a SELECT
         Statement stmt = con.createStatement();
         ResultSet rs = stmt.executeQuery
         ("SELECT Surname,FirstName,Category FROM Per");
         while (rs.next()) {
         // get current row values
         String Surname = rs.getString(1);
         String FirstName = rs.getString(2);
         int Category = rs.getInt(3);
         //create table row and add the value in the table
         IPrivate<Put View Name>.IEmployeeElement empElm = wdContext.createEmployeeElement();
            empElm.setSurname(Surname);
         empElm.setFirstName(FirstName);
         empElm.setCategory(Category);
         wdContext.nodeEmployee().addElement(empElm);
         // close statement and connection
         stmt.close();
         con.close();
    } catch (java.lang.Exception ex) {
         wdComponentAPI.getMessageManager().reportException("Exception : "ex.getMessage()+,true);
    http://www.developer.com/java/data/article.php/3417381
    Regards,
    Mithu

  • Insert data from java to oracle object created

    Hi
    How can i insert data from java to table test with column LIST_QRY_RES_DN_MEMBER_INFO as below after create object type
    CREATE OR REPLACE TYPE QRY_RES_SERVICE_VALUES AS OBJECT (
      PARAMETER_CODE            VARCHAR2(60),
      PARAMETER_VALUE           VARCHAR2(60)
    CREATE OR REPLACE TYPE LIST_QRY_RES_SERVICE_VALUES AS TABLE OF QRY_RES_SERVICE_VALUES;
    CREATE OR REPLACE TYPE QRY_RES_OPTIONS AS OBJECT (
      SERVICE_CODE            VARCHAR2(60),
      SERVICE_VALUE           LIST_QRY_RES_SERVICE_VALUES 
    CREATE OR REPLACE TYPE LIST_QRY_RES_OPTIONS AS TABLE OF QRY_RES_OPTIONS;
    CREATE OR REPLACE TYPE QRY_RES_MEMBER_INFO AS OBJECT (
      VARIABLE_CODE            VARCHAR2(60),
      VARIABLE_VALUE           VARCHAR2(120)
    CREATE OR REPLACE TYPE LIST_QRY_RES_MEMBER_INFO AS TABLE OF QRY_RES_MEMBER_INFO;
    CREATE OR REPLACE TYPE QRY_RES_DN_MEMBER_INFO AS OBJECT (
      DN                       VARCHAR2(60),
      MEMBER_INFO              LIST_QRY_RES_MEMBER_INFO,
      OPTIONS                  LIST_QRY_RES_OPTIONS
    CREATE OR REPLACE TYPE LIST_QRY_RES_DN_MEMBER_INFO AS TABLE OF QRY_RES_DN_MEMBER_INFO;
    CREATE TABLE test(
    DN_MEMBER_INFO          LIST_QRY_RES_DN_MEMBER_INFO,
    NESTED TABLE DN_MEMBER_INFO STORE AS LIST_QRY_RES_DN_MEMBER_TAB
        (NESTED TABLE MEMBER_INFO STORE AS MEMBER_INFO_TAB,
         NESTED TABLE OPTIONS STORE AS LIST_QRY_RES_OPTIONS_TAB
            (NESTED TABLE SERVICE_VALUE STORE AS SERVICE_VALUE_TAB));

    It appears you are trying to store java objects (types) in a database rather than raw data (string, int, date types) that the object contains. If so, I don't think that ever really caught on. Most programmers store the raw data, then pull it out and populate a class. The problem with storing the object is that new versions of classes come out and your old version is stored in the database. If you just store the data, you don't have to worry about what version is in the database. You can populate the new version of the class with the same data.
    Also, others can use sql to query your data and use it for their own use independent of what you intended it for. I think most people use the (browser) based utility that comes with the database to create the tables, normalize them, set up primary keys, set up foreign keys, etc rather then run an sql statement as you did above.

  • How to create Table Popins inside a table using Java Webdynpro

    Hi All,
    I am working on a Java Webdynpro project and one of our requirements is to create Table popins inside the Table. I need to popin data beneath the row based on a value selected from the DropDown Box which is one of the  column in the Table.
    Also, I need to display vertical scrollbar instead of  Table Footer to scroll thru the table rows. Any ideas.........
    I would appreciate if you can let me know how can I do this. I am working on the 7.0 version of Java Webdynpro.
    Thanks for your time and consideration!
    Regards,
    Madhavi

    Hi,
    Please refer the following link:
    Re: Table popins
    step by step procudure to create table popin on lead select.
    thanks & regards,
    Manoj
    Edited by: Manoj Kumar on Apr 1, 2008 10:17 AM

  • Creating an auto incrementing field with CREATE TABLE from Java

    I'm using the "sun.jdbc.odbc.JdbcOdbcDriver" to get a connection towards an ODBC data source that's linked to a Access (.mdb) database.
    I've tried various combinations in my CREATE TABLE statement execution in order to create a table with an auto incrementing integer but neither of them work, not even the most obvious one:
    stmt.executeUpdate("CREATE TABLE mytable(uid integer AUTO_INCREMENT PRIMARY KEY);");
    I always get this runtime exception: *java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition*; and AUTO_INCREMENT is the problem. I've tried all variations like AUTO, INCREMENT, AUTOINCREMENT and such, but nothing works.
    I've looked everywhere but couldn't find an answer to this. Thanks for the help.

    You used MySQL syntax. I think you agree with me that Access isn't a MySQL database. Either use MySQL with a real JDBC driver (recommended) or use Access syntax.
    That said, creating databases and tables using Java is a bad idea. The database and table must be already there. With Java you just do the usual table operations like select, insert, update and delete. Nothing more is needed.

  • Create XML file from table data

    Dear All,
    with dataservice 4.0, I want to create an XML file from a table data.
    Table have a single column but more record, for example:
    0001000488;100;EUR;
    0001000489;200;EUR;
    0001000450;300;EUR;
    My desired XML output:
    <Data>
      0001000488;100;GBP;
      0001000489;200;EUR;
      0001000450;300;EUR;
    </Data>
    I try with a sample query but the sistem write only the last record in XML file:
    <Data>
      0001000450;300;EUR;
    </Data>
    Can everyone help me?
    Thank in advance.
    Simone

    Hello
    That is a very simple (also odd) XML document structure, and as such doesn't require use of the XML target.  It can be easily acheived by writing a normal file with a header and footer, which is acheived using a row_generation and a query to generate the hard coded open and close tags.
    Michael

Maybe you are looking for

  • How to close all frames in a page?

    friends.. im having a html page(test.html) which has 3 frames. in one frame im having BACK button which takes me to the default page. But the problem is, when i click BACK button it loads the default.html in same frame itself...i want to open default

  • No longer able to boot into OSX

    My Mac Mini will only boot to Windows XP (I realise this situation is not without some degree of irony). Bootcamp has been installed for several months and I have had no problems booting between OSX and XP. I have not booted into XP recently only OSX

  • Associate a report to a data provider object

    Hi,   I am trying to associate / link a report to a its dataprovider object, how can i do that?  I am trying to display a report and also be able to get the sql statement for that object, but getSQL function only available from sqldataprovider.sqlcon

  • Attachments -- why can I drag them off on one computer but not another??...

    Hello -- I have two different Mac Pro's, an iBook and a Snow iMac. (Everything running OS X 10.5.7 except the iMac is 10.3.9.) On most of the computers, when I look at an email in Mail that has an mp3 attachment, I can just click-and-drag it right on

  • NI scope 5911

    Hello Guys,         Am using PCI 5911 scope card, When i'm putting this card in the computer and doing self test at first it is getting pass. But after 10 or 15 min the card getting more heat and the self test getting fail.         I cant trouble sho