Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

Sample Database Plugin

The sample database plugin project is designed to show an implementation of a database plugin that you can use as a basis to develop your own database plugins.

The sample database plugin registers the CSV JDBC driver from as a database in PDI. This enables reading from CSV files in a directory using basic SQL.

The included sample transformation in demo_transform/demo_database.ktr uses the database plugin to read a basic CSV file through JDBC.

Follow these steps in order to build and deploy the sample plugin.

  1. Obtain the Sample Plugin Source

    The database plugin source is available in the download package. Download the package and unzip it. The database plugin resides in the kettle-sdk-database-plugin folder.

  2. Configure the Build

    Open kettle-sdk-database-plugin/build/ and set the kettle-dir property to the base directory of your PDI installation.

  3. Build and Deploy

    You may choose to build and deploy the plugin from the command line, or work with the Eclipse IDE instead. Both options are described below.

    • Build and Deploy From the Command Line

      The plugin is built using Apache Ant. Build and deploy the plugin from the command line by invoking the install target from the build directory. 

      kettle-sdk-database-plugin $ cd build
      build $ ant install

      The install target compiles the source, creates a jar file, creates a plugin folder, and copies the plugin folder into the plugins/databases directory of your PDI installation. It also copies csvjdbc.jar to PDI's lib/ directory, which provides the JDBC driver the plugin depends on.

    • Build and Deploy From Eclipse

      Import the plugin sources into Eclipse:

      1. From the menu, select File > Import > Existing Projects Into Worksapace.
      2. Browse to the kettle-sdk-database-plugin folder and choose the project to be imported. 
      To build and install the plugin, follow these steps:
      1. Open the Ant view in Eclipse by selecting Window > Show View from the main menu and select Ant.

        You may have to select Other > Ant if you have not used the Ant view before.

      2. Drag the file build/build.xml from your project into the Ant view, and execute the install target by double-clicking it.
      3. After the plugin has been deployed, restart Spoon.
  4. You can test the new plugin using the transformation from the database plugin demo_transform folder.