Ready to get started?

Download a free trial of the REST Driver to get started:

 Download Now

Learn more:

REST Icon REST JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with REST web services.

Connect to REST Data and Transfer Data in Talend



Integrate REST data with standard components and data source configuration wizards in Talend Open Studio.

This article shows how you can easily integrate the CData JDBC driver for REST into your workflow in Talend. This article uses the CData JDBC Driver for REST to transfer REST data in a job flow in Talend.

Connect to REST in Talend as a JDBC Data Source

You can follow the procedure below to establish a JDBC connection to REST:

  1. Add a new database connection to REST data: To add a new connection, expand the Metadata node, right-click the Db Connections node, and then click Create Connection.
  2. In the resulting wizard, enter a name for the connection.
  3. On the next page, select Generic JDBC from the DB Type menu and enter the JDBC URL.

    See the Getting Started chapter in the data provider documentation to authenticate to your data source: The data provider models REST APIs as bidirectional database tables and XML/JSON files as read-only views (local files, files stored on popular cloud services, and FTP servers). The major authentication schemes are supported, including HTTP Basic, Digest, NTLM, OAuth, and FTP. See the Getting Started chapter in the data provider documentation for authentication guides.

    After setting the URI and providing any authentication values, set Format to "XML" or "JSON" and set DataModel to more closely match the data representation to the structure of your data.

    The DataModel property is the controlling property over how your data is represented into tables and toggles the following basic configurations.

    • Document (default): Model a top-level, document view of your REST data. The data provider returns nested elements as aggregates of data.
    • FlattenedDocuments: Implicitly join nested documents and their parents into a single table.
    • Relational: Return individual, related tables from hierarchical data. The tables contain a primary key and a foreign key that links to the parent document.

    See the Modeling REST Data chapter for more information on configuring the relational representation. You will also find the sample data used in the following examples. The data includes entries for people, the cars they own, and various maintenance services performed on those cars.

    Built-in Connection String Designer

    For assistance in constructing the JDBC URL, use the connection string designer built into the REST JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

    java -jar cdata.jdbc.rest.jar

    Fill in the connection properties and copy the connection string to the clipboard.

    A typical JDBC URL is below:

    jdbc:rest:DataModel=Relational;URI=C:/people.xml;Format=XML;
  4. Enter the path to the cdata.jdbc.rest.jar file, located in the lib subfolder of the installation directory.
  5. Right-click the connection and then click Retrieve Schema.
  6. Click Next with the default options to select the tables you want to import.
  7. Finish the wizard with the default options.

Output the People Table to a Flat File

You can follow the procedure below to transfer the people table to a flat file output component:

  1. In the Table Schemas node, drag the tables to the workspace.
  2. In the dialog that is displayed, select the tJDBCInput component.
  3. Next, drag a tFileOutputDelimited component from the Business Intelligence tab of the Palette into the workspace.
  4. Right-click the people tJDBCInput component and drag a vector to the output file.

Run the project to transfer the data.