Export Database Table to JSON in Talend

In this section, we show how to use tFileOutputJSON to export the Database table to JSON in Talend with an example. For this Talend tFileOutputJSON demo, we are using the SQL Database table, and the data inside this table is

Export Database Table to JSON in Talend 0

Talend Export Database Table to JSON File example

From the following image, you can see that we established a SQL connection. Within the tDBInput, we selected the Customer table.

Export Database Table to JSON in Talend 2

Next, drag and drop the tFileOutputJSON output field from the palette. As you can see from the tooltip, the Talend tFileOutputJSON creates a JSON structure from rows.

Please connect the DBInput source to tFileOutputJSON. The following tFileOutputJSON image shows the list of options available in the Talend tFileOutputJSON component tab to export database table to excel file.

Export Database Table to JSON in Talend 3

Please click on the Edit Schema button to check the tFileOutputJSON schema.

Export Database Table to JSON in Talend 4

By default, the File name of the tFileOutputJSON output field selects the default location and out.json as the JSON file name. Please click the browse (…) button to choose the existing JSON file or create a new JSON file. Here, we are creating the jsonCustomers.json in the Output files directory.

Export Database Table to JSON in Talend 5

Let me check all the Talend tFileOutputJSON properties.

Export Database Table to JSON in Talend 6

Let me run this Talend export database table to JSON job.

Export Database Table to JSON in Talend 7

The below screenshot shows you the output.

Export Database Table to JSON in Talend 8

Let me expand the file for a better view.

Export Database Table to JSON in Talend 9