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, [AdminShell|AdminShell], admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.
Execute following command using [CLI|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI] 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.
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
To find out all the properties that are supported by this File Connector execute the following command in the CLI./subsystem=teiid:read-rar-description(rar-name=teiid-connector-file.rar) |
| 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. |
| Developer's Tip If the JBoss AS 7.x is running in standalone mode, you can also manually edit the "<jboss-install>/standalone/configuration/standalone-teiid.xml" file and add the XML configuration defined in "<jboss-install>/docs/teiid/datasources/file" directory under "resource-adapters" subsystem. Shutdown the server before you edit this file, and restart after the modifications are done. |