Using Teiid designer for Data Virtualization

This is the second tutorial about Teiid, the data virtualization platform developed by JBoss team and supported as JBoss Data Virtualization.

In this tutorial we will use Teiid designer to model a Relational database just using the wizards of the Designer.

Start by downloading the Teeid designer from: http://teiiddesigner.jboss.org/downloads

In my case I already got the designer installed by using JBoss Developer Studio

Once installed choose Windows | Open Perspective | Teiid Designer

Using Teiid designer for Data Virtualization

The Modeling Actions wizard will guide us in creating a Model for a JDBC datasource.

1. Define a New Teiid Model Project

Start by double clicking on Define Teiid Model Project ( or choose New Teiid Model Project from the top menu). Enter the Model Project name

Using Teiid designer for Data Virtualization

Next accept the defaults.

Using Teiid designer for Data Virtualization

2. Create a JDBC Connection.

In this wizard you will define the driver and connection details of your database. Choose the database, add the JDBC Driver and define the database connection properties. Once you have tested the connection you can click on Finish

Using Teiid designer for Data Virtualization

3. Create a source Model for your project.

Having defined the data source, we can define which data will be imported in our project. Double click on "Create source model for JDBC datasource" . In the following window select the Connection profile from the combo box:

Using Teiid designer for Data Virtualization

Click on Next. In the following UI select the tables from your schema which will be imported in our model:

Using Teiid designer for Data Virtualization

Choose the Model name:

Using Teiid designer for Data Virtualization

As a result, the table/s will be imported and the model (MySQL.xmi) will be created. It's time to test it.

Using Teiid designer for Data Virtualization

As first choice, you will need to define a new Server server. Right click on the Server panel and add a new EAP 6 server pointing to the Teiid application server that you have downloaded. Start the Server

Using Teiid designer for Data Virtualization

4. Create a Virtual Database for our project.

A virtual database (or VDB) is a container for components used to integrate data from multiple data sources, so that they can be accessed in an integrated manner through a single, uniform API.

Double click on Define VDB and associate the Virtual Database with our Model:

Using Teiid designer for Data Virtualization

Good. Now You can click on Execute VDB. You will need to pickup the MDB as follows:

Using Teiid designer for Data Virtualization

In the SQL scrapbook enter the SQL and choose "Execute Selected Text". In the SQL Results you will see the output of your query:

 id name  surname email
 -- ----- ------- -----------------
  1 john  smith   jsmithATemail.com
  2 willy wonka   wwonkaATemail.com  
  3 steve brooks  sbrooksATemail.com

Great! You have just learnt how to create a simple Virtual Database which relies on a RDBMS for collecting its data.

Follow us on Twitter