10 Replies Latest reply on Dec 21, 2014 8:32 AM by tarifezaz

    How to connect to and retrieve data from CSV files using Teiid?

    tarifezaz

      Dear all,

       

      I have been trying to access CSV files for performing CRUD operations using Teiid. I have already inserted the resource adapter in standalone-teiid.xml file. Here's the file specific resource adapter.

       

      <resource-adapter id="file">

           <module slot="main" id="org.jboss.teiid.resource-adapter.file"/>

           <transaction-support>NoTransaction</transaction-support>

           <connection-definitions>

                <connection-definition class-name="org.teiid.resource.adapter.file.FileManagedConnectionFactory"

                     jndi-name="java:/fileDS"

                     enabled="true"

                     use-java-context="true"

                     pool-name="teiid-file-ds">

                            

                     <config-property name="ParentDirectory">/home/tarif/testing/</config-property>

                          

                     <config-property name="AllowParentPaths">true</config-property>

                 </connection-definition>

            </connection-definitions>

      </resource-adapter>

       

      I have saved a CSV file under the /home/tarif/testing directory. I have also deployed a virtual database for file. Here's the XML for that file:

       

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

          <model name = "filemodel">

              <source name="fileitis" translator-name="file" connection-jndi-name="java:/fileDS"/>

          </model>

      </vdb>

       

      When I am running the ./standalone.sh command, the VDB myfileVDB is being set to active. But when I am running a query using JDBC to show all the available tables, I can't see any name for the CSV file that I have saved inside the /home/tarif/testing directory. Should I somehow need to specify that file so that the information regarding that file becomes visible from Teiid JDBC?

       

      Regards

      Tarif