JasperSoft iReport with JDBC Driver

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.

Table of Contents

Prerequisites

Untitled-3
Don't have time to setup 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.

Untitled-3
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

Let’s add Treasure Data as Jasper’s data source. Please follow the procedure below.

Step1: Add the JDBC Driver Jar to Classpath

Please 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.

Step2: Create a New Data Source

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

Step3: Configure your JDBC Connection

Please configure your jdbc parameters as shown in the following figure. Please make sure to provide your credentials (your email + password).

Untitled-3
Treasure Data's JDBC driver will NOT appear in the "JDBC Driver" dropdown. Please click on the dropdown area and type `com.treasure_data.jdbc.TreasureDataDriver`.


Step4: 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 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 in order for the above query to work.

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

     code:string
    

    )

(The Schema article explains how to add/remove/modify schema on our system.)

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




Last modified: Jul 07 2016 19:00:56 UTC

If this article is incorrect or outdated, or omits critical information, please let us know. For all other issues, please see our support channels.