JDBC Config Source
The JDBC config source reads configuration properties from a database table.
Configuration
You can configure JDBC Config Source either via the admin console or the asadmin utility. You’ll need the JNDI name of the database JDBC resources, name of a database table, name of the key column containing the key and name of the column containing the value.
The values from the key column will be used as the config property names and the values from the value column will be used as the config property value.
The type of the database columns for the key and value columns needs to be of type `String` or compatible. |
From the Admin Console
To configure the config source from the admin console, go to Configs
→ your-config
→ MicroProfile
→ Config
→ JDBC
.
From here you configure the JNDI name of the database JDBC resources, name of the database table, name of the key column containing the key and name of the column containing the value.
Usage
Once all required options are configured. You should be able to read configuration properties from a database table.
For example, let’s look at the following diagram. It shows a table named Books with columns ISBN, Author and Title.
If the key column name is set to ISBN
and the value column name to Title
. You can get the value of the Title column in relation to the ISBN column using the following command along with the ISBN value:
asadmin get-config-property --source jdbc --propertyName 9780030779008
Great Expectations
Command get-config-property executed successfully.
Currently, the JDBC config source only supports the get-config-property command and doesn’t support the set-config-property and delete-config-property commands.
|