Red Hat Training

A Red Hat training course is available for Red Hat JBoss Data Virtualization

12.3. Connecting Red Hat JBoss Data Virtualization to an Azure Instance

Follow these instructions to connect to your Azure database:

Procedure 12.3. Connecting to Azure

  1. Get the JDBC connection string for your Azure database. In the Azure management portal, click on the database then find the Connect to your database section.
  2. Click on the View SQL Database connection strings... link. This will give you the JDBC strings you require.
  3. The cloud database requires that the IP address of the machine accessing it be registered in its firewall rules. On the Azure database dashboard, click Manage allowed IP addresses, then add the IP address of your server. This is straightforward if the DV instance resides on your local server.
  4. If the DV instance is deployed on OpenShift, ssh into your OpenShift instance. On the command line, enter ping $OPENSHIFT_GEAR_DNS. The first line of the ping response will look like this:
                       PING ec2-54-221-126-53.compute-1.amazonaws.com (10.181.128.66) 56(84) bytes of data.
    You can infer the IP of your server from the ec2 name:
    
            ec2-54-221-126-53  -->  ( 54.221.126.53 )
    Register the derived ip address in the cloud db firewall rules.
  5. JBoss Data Virtualization uses a model-driven approach. First, you will create a source model by connecting to the source and importing its structure.
    In Teiid Designer, open the Teiid Designer perspective. Then create a new Model Project by selecting File - New - Teiid Model Project. On the first wizard page, enter MyProject for the project name - then click Finish. The project will be created.
  6. In Model Explorer, click MyProject, then Right-Click - Import... - JDBC Database - Source Model. Click Next.
  7. In the Import Database via JDBC wizard, click the New... button to create a new Connection Profile. Select Generic JDBC for the type. Enter AzureCP for the Name. Click Next.
  8. Next to the Drivers combo box, select the New Driver Definition icon to create a new driver. Select the Generic JDBC Driver template, then enter AzureDriver for the Name.
  9. On the JAR List tab, click the Add JAR/Zip... button, then select a SQL Server type 4 driver jar that you've previously downloaded to your file system. Click OK to finish creating the Driver Definition.
  10. For the connection, enter the general properties using your database name and so forth as provided in the cloud db connection string.
  11. Enter the Optional properties from the connection string.
  12. Click the Test Connection button to ensure a successful connection. Click Finish.
  13. Continue in the JDBC import wizard, selecting the tables and so forth that you want to import. Choose a name for your source model (such as AzureSourceModel). Upon completion of the import wizard, the source model will be created within your model project.
After the source model has been created, you can now preview data from the cloud database source:

Procedure 12.4. Previewing Data

  1. In Designer, make sure your server is running.
  2. Select a table, then click the 'running man' icon in the toolbar. This will display the content in your cloud database table.
  3. You can also create more complex transformations using the source model that you just created: Create additional views which transform and join sources in any way you like.