MuleSoft


MuleSoft


This page outlines the steps to install and configure the CData Connect Cloud connector for MuleSoft. After installation, MuleSoft can pull data from sources that you have connected to your CData Connect Cloud account.

Prerequisites

Before you can configure and use MuleSoft with CData Connect Cloud, you must first connect a data source to your CData Connect Cloud account. See Connections for more information.

You must also generate a Personal Access Token (PAT) on the Settings page. Copy this down, as it acts as your password during authentication.

Connecting to CData Connect Cloud

To establish a connection from MuleSoft to CData Connect Cloud through the JDBC driver, follow these steps.

  1. Download and install the CData Connect Cloud JDBC driver.
    1. Open the Client Tools page of CData Connect Cloud.
    2. In the Dev Tools section, click JDBC.
    3. Download and run the setup file.
    4. When the installation is complete, the JAR file can be found in the installation directory.
  2. Log into MuleSoft Anypoint Studio or launch the desktop application.

  3. Create a new MuleSoft project.

    The new project appears in a project folder.

  4. In the Mule Palette on the right, drag a HTTP Listener to the Message Flow area.

  5. Click the HTTP Listener to configure it.

  6. Click the + sign to the right of Connector configuration. The HTTP Listener config dialog appears.

  7. Configure the HTTP Listener, providing a Port on which to query your data, and click OK.

  8. Provide a path on which to perform the actions. The HTTP Listener is now configured.

  9. In the Mule Palette on the right, type database in the search bar.

  10. Drag the database operation you want to perform to the Message Flow area. For this example, we choose Select.

  11. Click the Configure button to configure the JDBC driver. Select Use local file from the drop-down list.

  12. Locate the CData Connect Cloud JAR file from the JDBC driver installation and click OK.

  13. Provide the following information:

    • URL–the URL for the connection, for example: jdbc:connect:Authscheme=Basic;user=username;password=password.

      Note: the password is the PAT created in the prerequisites.

    • Driver class namecdata.jdbc.connect.ConnectDriver

  14. Click Test Connection.

  15. If the connection is successful, provide the SQL Query Text in the editor. You can see the metadata of the table on the right side in the Output tab.

  16. In the Mule Palette, drag Transform Message to the Message Flow area.

  17. Click Transform Message to configure it. Change the Output as follows:

  18. Save your project and run it. In the console, MuleSoft starts initializing the dependencies.

  19. Once you see the message, Message source 'listener' on flow your_project_name successfully started, you can start querying your data at the endpoint you provided.