This article explains how to use Treasure Data with JasperSoft iReport, by leveraging our JDBC driver. By combining Treasure Data with JasperSoft, you can process terabytes of data on the cloud, while continuing to use your existing JasperSoft instances.


  • Basic knowledge of Treasure Data.

  • The Schema article explains how to manipulate the TD schema.

Don't have time to set up JasperSoft + Treasure Data? Leverage our Setup Consultation Service.

Download JasperSoft iReport

You can download JasperSoft iReport from the link below. Version 4.6.0 was used for this article.

Download the Treasure Data JDBC Driver

You can download the driver itself from the link below. The driver is still in beta; any feedback is appreciated.

This driver only works with Treasure Data. It does not run on other environments, such as your local Hadoop/Hive cluster.

Add Treasure Data as Data Source

To add Treasure Data as Jasper’s data source, follow the procedure below.

Add the JDBC Driver Jar to Classpath

Go to Preferences -> iReport Tab -> Classpath, and press the Add Jar button. Select the downloaded JDBC driver and check the Reloadable box in the table.

Create a New Data Source

Press the database icon, which is located near the ‘Empty datasource’ indicator. Add a new data source with type: Database JDBC connection.

Configure your JDBC Connection

Configure your JDBC parameters as shown in the following figure. Make sure to provide your credentials (your email + password).

Treasure Data's JDBC driver will NOT appear in the "JDBC Driver" dropdown. Select the dropdown area and type `com.treasure_data.jdbc.TreasureDataDriver`.

Create Reports

The procedure for this step is identical to creating reports with a JDBC source.

First, create a report by navigating to File -> New -> Report. Make sure that your data source is set to “TreasureData” (or your name for our JDBC connection).

Here, the query is

SELECT code, COUNT(1) AS count FROM apache_log GROUP BY code

Some notes about this sample data:

  1. The data in this table is taken from a typical Apache log. The field code corresponds to the HTTP status code. Essentially, we are counting the number of HTTP requests per status code.

  2. Treasure Data does not have a pre-defined schema out of the box. We, therefore, need to add schema for the field named code for the above query to work.

    $ td table:show demo apache_log Name : demo.apache_log  
    Type : log Count : 25000000 Schema : (code:string)

The rest of the setup is exactly the same as any other report.

  • No labels