JBoss.orgCommunity Documentation
This examples uses two data sources, a relational database and a text file. An HSQL database is used here since it is Open Source, comes with JBoss AS and is light-weight. This section will describe how to setup the data sources in order to run the example.
We need to create and deploy the required Connection Factories for HSQL database and File sources. Connection Factories are sources that provide the data when their data is integrated through Teiid. If you are familiar with creating data sources or connection factories in JBoss AS, then this is exactly the same operation
Perform the following steps to install and setup the data sources:
Copy the following files from "teiid-examples/dynamicvdb-portfolio" directory to the "<jboss-install>/server/default/deploy" directory
(1) portfolio-ds.xml
(2) marketdata-file-ds.xml
If the server has not been started, start it
Using a web browser, goto the JMX console (http://localhost:8080/jmx-console/) and select: database-portfolioDB,service=PortfolioService to present the bean options.
Now click invoke "startDatabaseManager" to bring up HSQL Database Manager
Use the File/Open Script menu option to load the customer-schema.sql script located in "teiid-examples/dynamicvdb-portfolio"
Click the Execute SQL button to create the required tables and insert the example data
Make sure you did not have any issues when creating the schema as it is needed for going forward in this example.
In order to use a Text file as the source, we need a data file which defines the data in the table
Data File: Each data file contains column information for the table. The column information is typically defined on line 1 as header line in the file, and all the following lines contain the actual rows of data. Each single line corresponds to single row. A portion of the sample file is shown below. The complete sample file is "teiid-examples/dynamicvdb-portfolio/data/marketdata-price.txt".
SYMBOL,PRICE IBM,83.46 RHT,11.84 BA, 44.58 ORCL,17.37
You can use the provide data files or create your own data files.
At this point, both data sources are ready to access.