# Pentaho Data Import Integration

This article explains how to use Treasure Data with [Pentaho Data Integration](https://www.hitachivantara.com/en-us/home.html) using [presto-jdbc driver](https://trino.io/docs/423/client/jdbc.html). By combining Treasure Data with Pentaho, users can scale their existing Pentaho Data Integration environment to handle huge volumes of data.

## Prerequisites

- Basic knowledge of Treasure Data.


## Download Pentaho Data Integration (Kettle)

You can download Pentaho Data Integration (Kettle) from the link below. Version 8.2 was tested for this article

- [Pentaho Data Integration (Kettle)](http://kettle.pentaho.com/)


## Download JDBC Driver

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

To work with Pentaho, you must use **td-jdbc-VERSION-jar-with-dependencies.jar file.**

- [JDBC Driver Download](https://mvnrepository.com/artifact/com.treasuredata/td-jdbc/0.5.10)


Treasure Data JDBD driver is deprecated.

## Copy JDBC Driver jar to Pentaho Data Integration

Before starting Pentaho Data Integration, please copy the Treasure Data JDBC driver to the `lib` directory specified by Pentaho Data Integration.


```bash
$ cp td-jdbc-VERSION-jar-with-dependencies.jar  \
  pentaho-data-integration-install/data-integration/lib
```

## Create Treasure Data Database Connection

Connect Treasure Data to Pentaho Data Integration’s database connection and make a new transformation. Please follow the procedure below.

## Create a New Transform

1. Open the Pentaho DI application.


![](/assets/pentaho1.5627a392657af19d960c7162f85ea3463a4dbf166ac959051e1c1d6978171008.22c8db65.png)
2. Select File > New > Transformation

![](/assets/pentaho2.008f0b6a615c5aa4de9137bacc2cb9d8706a351df3960390165d638e70e11a6c.22c8db65.png)

## Create New Database Connection

1. Navigate to Tools > Wizard > Create database connection.
![](/assets/pentaho3.d87a8e1870c7857e0607440a8e32ef8bcc282615de3f1822a141f986a5aaa7d6.22c8db65.png)
2. Edit the details in the pop-up dialog.
  - Name the database connection
  - Select Generic Database for type of database
  - Select Native (JDBC) for type of database access
![](/assets/pentaho4.0698ebb9ee9549dfbcac94e1f31db92ce4be023c0bce8803a005f7f0d53cbac8.22c8db65.png)
3. Specify the connection’s URL (view [API endpoints](/apis/endpoints/endpoints)) and the name of the driver class.
  - Driver class is com.treasuredata.jdbc.TreasureDataDriver
![](/assets/screen-shot-2022-07-20-at-9.38.45.a82a5acbea14d9332063794361e9a5f8917260c8dea70faf551d8176f4b49f4d.22c8db65.png)
The URL can be specified in any of the following ways:
  - `jdbc:td://api.treasuredata.com/<db\_name>`
  - use `jdbc:td://api.treasuredata.com/<db\_name>;useSSL=True`  if you want to enforce SSL
  - You can choose the query engine
    - [Hive](/products/customer-data-platform/data-workbench/queries/hive/quickstart)
    - [Presto](/products/customer-data-platform/data-workbench/queries/trino/quickstart) (default) by the parameter
  - `jdbc:td://api.treasuredata.com/sample_db;useSSL=true;type=hive`
  - `jdbc:td://api.treasuredata.com/sample_db;useSSL=true;type=presto`
4. Specify your username and password. Use your Treasure Data credentials for these fields (Your User Name is the email address used to register on Treasure Data).


- Select Test database connection.


![](/assets/pentaho6.4daefaf1a1a5b0acd8ac8eb0c59d5d50ae9d25969e71d1bf25b118f6cf915253.22c8db65.png)

# Use Treasure Data Database as Table Input

## Specify Table Input

1. Select **Table Input** from the transform’s Input menu.
2. Drag and drop onto the workspace as follows:


![](/assets/image-20190927-233140.7666969354b64786b3fc1dede46cacdcd2a295214221d23fe079173a3e3fa7e2.22c8db65.png)

## Edit the Table Input

1. Right-click the Table input icon on the workspace.
2. Select **Edit** from the context menu.
3. Configure your Table input as follows:


![](/assets/image-20190927-233323.c8d7888cf3e443e33140d2156318b507c9b9e335bb85c6bdb68b4fd23d15abdd.22c8db65.png)

The preceding query is reviewed in the [JasperSoft iReport with JDBC Driver](/int/jaspersoft-ireport-export-integration) article.

## Confirm the Table Input

To confirm the behavior of the Table input, send your data on Treasure Data to JSON output as follows:

![](/assets/image-20190927-233412.e1150c1c21103f781da15266ee8c4b0ca9ebbfa862fa0baf12a5508e34f02a31.22c8db65.png)

# Tip: How can I use Pentaho through a proxy?

Check ‘start-pentaho.bat’ or ‘start-pentaho.sh’, and add the following parameters to CATALINA_OPTS option:


```
CATALINA_OPTS="-Dhttp.proxyHost=proxy address -Dhttp.proxyPort=proxy port"
```