Skip to content
Stable

This component is complete and can be used. The interfaces will be supported until the function is removed from the project via the deprecation process. There will be ongoing extensions to this function, but it will be done to ensure backward compatibility as far as possible. If there is a need to break backward compatibility, this will be discussed and reviewed in the community, with a documented timeline.

JDBC Resource Connector

Connector summary

The JDBC Resource Connector provides a DataSource, which in turn is used to get a connection to underlying database. It provides access to both the schema metadata and the business data content.

Figure 1

Figure 1: JDBC resource connector

Usage

The connector is initialized using the connection information attached to the RelationalDatabase asset in the open metadata ecosystem.

Figure 2

Figure 2: Connection information used to create an instance of the JDBC resource connector

The optional configuration properties supported by this connector are:

  • jdbcDriverManagerClassName - requests the named class to be loaded and registered as a driver. This property only needs to be defined if the connector is experiencing exceptions related to a missing DriverManager class for the database URL.
  • jdbcConnectionTimeout - sets the maximum time in seconds that this data source will wait while attempting to connect to a database. The default value is 0 which means use the system default timeout, if any; otherwise it means no timeout.
  • jdbcDatabaseName - provides a name to use in messages about the database. If it is not set then the connection URL string is used.

Below is an example connection for a PostgreSQL database:

{
    "class": "Connection",
    "connectorType": {
      "class": "ConnectorType",
      "connectorProviderClassName": "org.odpi.openmetadata.adapters.connectors.resource.jdbc.JDBCResourceConnectorProvider"
    },
    "endpoint": {
      "class": "Endpoint",
      "address": "jdbc:postgresql://localhost:5432/myDatabase"
    },
    "userId": "xxxxx",
    "clearPassword": "xxxx",
    "configurationProperties": {
      "jdbcDriverManagerClassName": "org.postgresql.Driver",
      "jdbcConnectionTimeout": "10",
      "jdbcDatabaseName": "MyDatabase"
    }
}

Raise an issue or comment below