<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/File+Data+Sources">File Data Sources</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://docs.jboss.org/author/display/~van.halbert">Van Halbert</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="FileDataSources-"></a><font color="#000000"><b>File Data Sources</b></font></h1>

<p><font color="#333333">File data sources use a Teiid specific JCA connector "teiid-connector-file.rar", which is deployed into the AS7.x during installation. There are many ways to create the file data source, using CLI,&nbsp;</font><font color="#005e8f">[<font color="#005e8f"></font>AdminShell</font>|AdminShell]<font color=""><font color="#333333"></font>, admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.</font></p>

<p><font color="#333333">Execute following command using&nbsp;</font><font color="#005e8f">[<font color="#005e8f"></font>CLI</font>|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI]<font color=""><font color="#333333"></font>&nbsp;once you connected to the Server. Make sure you provide the correct directory name and other properties below. Add any additional properties required by the connector by duplicating the "connection-definitions" command below. Edit the JNDI name to match the JNDI name you used in VDB.</font></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
batch

/subsystem=resource-adapters/resource-adapter=fileDS:add(archive=teiid-connector-file.rar, transaction-support=NoTransaction)

/subsystem=resource-adapters/resource-adapter=fileDS/connection-definitions=fileDS:add(jndi-name=java:/fileDS, class-name=org.teiid.resource.adapter.file.FileManagedConnectionFactory, enabled=true, use-java-context=true)

/subsystem=resource-adapters/resource-adapter=fileDS/connection-definitions=fileDS/config-properties=Parentdirectory:add(value=/home/rareddy/testing/)

/subsystem=resource-adapters/resource-adapter=fileDS/connection-definitions=fileDS/config-properties=AllowParentPaths:add(value=true)

/subsystem=resource-adapters/resource-adapter=fileDS/connection-definitions=fileDS:enable

runbatch
</pre>
</div></div>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><font color="#333333">To find out all the properties that are supported by this File Connector execute the following command in the CLI.</font><br/>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">/subsystem=teiid:read-rar-description(rar-name=teiid-connector-file.rar)</pre>
</div></div><font color="#333333">&nbsp;</font></td></tr></table></div>
<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><font color="#333333">As of AS 7.1 CR1b release the above does not work without restarting the Server. This issue will be fixed before 7.2 Final.</font></td></tr></table></div>
<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Developer's Tip</b><br /><font color="#333333">If the JBoss AS 7.x is running in standalone mode, you can also manually edit the "&lt;jboss-install&gt;/standalone/configuration/standalone-teiid.xml" file and add the XML configuration defined in "&lt;jboss-install&gt;/docs/teiid/datasources/file" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done.</font></td></tr></table></div>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
       <a href="https://docs.jboss.org/author/display/TEIID/File+Data+Sources">View Online</a>
              |
       <a href="https://docs.jboss.org/author/display/TEIID/File+Data+Sources?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>