2 Replies Latest reply on Feb 18, 2016 1:39 PM by Benedikt Tröster

    How can I (Automatically) add multiple Excel files in the same folder as a datasource?

    Benedikt Tröster Newbie

      Hello everyone!

       

      Title pretty much says it all: I'd like to add all the Excel files in a given folder as a datasource.

      What I have so far:

      A connection definition in my standalone-teiid.xml:

      <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory" jndi-name="java:/excel-file-NAME" enabled="true" use-java-context="true" pool-name="NAME">

        <config-property name="AllowParentPaths">

        true

        </config-property>

        <config-property name="ParentDirectory">

        D:/path/to/folder/

        </config-property>

      </connection-definition>

       

      Now I know I need to create a multisource model for my dynamic VDB definition:

      <vdb name="snik" version="1"> 

      <model visible="true" name="projBudgetList">
      <property name="multisource" value="true"/>

              <property name="importer.headerRowNumber" value="2"/>

      <property name="importer.dataRowNumber" value="2" />

              <property name="importer.ExcelFileName" value="WHATDOIPUTHERE?"/>

              <source name="excelconnector" translator-name="excel"  connection-jndi-name="java:/excel-file-snik-budgetlisten"/>

          </model>

      </vdb> 

       

      I'm not sure this is even a feature, but I'd be happy about any kind of input you have on that matter.

       

      Thanks a lot!

      Benedikt