Skip to main content
Pentaho Documentation

Creating Database Plugins

PDI uses database plugins to support specific database systems beyond generic JDBC functionality. A database plugin helps in the following areas:

  • constructing connection strings
  • passing connection settings to JDBC
  • dialect-aware SQL generation
  • detecting special abilities and limitations of JDBC drivers

A database plugin introduces a new entry in the PDI database dialog. 


File:/screenshot_database_dialog.png

This section explains the architecture and programming concepts for creating your own database plugin. We recommended that you open and refer to the sample database plugin sources while following these instructions.

PDI database plugins consist of a single Java class that implements the interface org.pentaho.di.core.database.DatabaseInterface

In order for PDI to recognize the database plugin, the class implementing DatabaseInterface must also be annotated with the Java annotation org.pentaho.di.core.plugins.DatabaseMetaPlugin

Supply these annotation attributes.

Attribute Description
type A globally unique ID for database plugin
typeDescription The label to use in the database dialog

It is recommended to extend org.pentaho.di.core.database.BaseDatabaseMeta, which provides default implementations for most of the methods in DatabaseInterface. Existing PDI database interfaces are a great source of information when developing a new database plugin.

The following section classifies some of the most commonly overridden methods. They can be roughly classified into three subject areas: information about connections, SQL dialect, and general capability flags. 

1. Connection Details

These methods are called when PDI establishes a connection to the database, or the database dialog is populated with database-specific defaults.

2. SQL Generation

These methods are called when PDI constructs SQL.

3. Capability Flags

These methods are called when PDI determines the run-time characteristics of the database system. For instance, the database systems may support different notions of metadata retrieval.