h1. {color:#000000}{*}File Data Sources{*}{color} |
h1. *File Data Sources* |
|
{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, {color}{color:#005e8f}[{color:#005e8f}AdminShell{color}|AdminShell]{color}{color:#333333}, CLI, [AdminShell |AdminShell] , admin-console etc. The example shown below uses the CLI tool, as this works in both Standalone and Domain modes.{color} |
|
{color:#333333}Execute following command using {color}{color:#005e8f}[{color:#005e8f}CLI{color}|https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-RunningtheCLI]{color}{color:#333333} 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.{color} |
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. |
{code} batch |
/subsystem=resource-adapters/resource-adapter=file/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=file/connection-definitions=fileDS/config-properties=Parentdirectory:add(value=/home/rareddy/testing/) |
/subsystem=resource-adapters/resource-adapter=fileDS:add(archive=teiid-connector-file.rar, transaction-support=NoTransaction) |
/subsystem=resource-adapters/resource-adapter=file/connection-definitions=fileDS/config-properties=AllowParentPaths:add(value=true) |
/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=file:activate |
/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 {code} {info} |
{color:#333333}To find out all the properties that are supported by this File Connector execute the following command in the CLI.{color} {code}/subsystem=teiid:read-rar-description(rar-name=teiid-connector-file.rar){code}{color:#333333} {color}{info} {warning} /subsystem=teiid:read-rar-description(rar-name=file) |
{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.{color}{warning} |
{code} {info} |
{tip:title=Developer's Tip} |
{color:#333333}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.{color}{tip} |
{tip} |
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 , 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 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=file/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=file/connection-definitions=fileDS/config-properties=Parentdirectory:add(value=/home/rareddy/testing/) /subsystem=resource-adapters/resource-adapter=file/connection-definitions=fileDS/config-properties=AllowParentPaths:add(value=true) /subsystem=resource-adapters/resource-adapter=file:activate 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=file) |
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. |