Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →A PostgreSQL Interface for HCL Domino Data
Use the Remoting features of the HCL Domino JDBC Driver to create a PostgreSQL entry-point for data access.
There are a vast number of PostgreSQL clients available on the Internet. From standard Drivers to BI and Analytics tools, PostgreSQL is a popular interface for data access. Using our JDBC Drivers, you can now create PostgreSQL entry-points that you can connect to from any standard client.
To access HCL Domino data as a PostgreSQL database, use the CData JDBC Driver for HCL Domino and a JDBC foreign data wrapper (FDW). In this article, we compile the FDW, install it, and query HCL Domino data from PostgreSQL Server.
Connect to HCL Domino Data as a JDBC Data Source
To connect to HCL Domino as a JDBC data source, you will need the following:
- Driver JAR path: The JAR is located in the lib subfolder of the installation directory.
Driver class:
cdata.jdbc.domino.DominoDriver
- JDBC URL:
The URL must start with "jdbc:domino:" and can include any of the connection properties in name-value pairs separated with semicolons.
Connecting to Domino
To connect to Domino data, set the following properties:
- URL: The host name or IP of the server hosting the Domino database. Include the port of the server hosting the Domino database. For example: http://sampleserver:1234/
- DatabaseScope: The name of a scope in the Domino Web UI. The driver exposes forms and views for the schema governed by the specified scope. In the Domino Admin UI, select the Scopes menu in the sidebar. Set this property to the name of an existing scope.
Authenticating with Domino
Domino supports authenticating via login credentials or an Azure Active Directory OAuth application:
Login Credentials
To authenticate with login credentials, set the following properties:
- AuthScheme: Set this to "OAuthPassword"
- User: The username of the authenticating Domino user
- Password: The password associated with the authenticating Domino user
The driver uses the login credentials to automatically perform an OAuth token exchange.
AzureAD
This authentication method uses Azure Active Directory as an IdP to obtain a JWT token. You need to create a custom OAuth application in Azure Active Directory and configure it as an IdP. To do so, follow the instructions in the Help documentation. Then set the following properties:
- AuthScheme: Set this to "AzureAD"
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- OAuthClientId: The Client ID obtained when setting up the custom OAuth application.
- OAuthClientSecret: The Client secret obtained when setting up the custom OAuth application.
- CallbackURL: The redirect URI defined when you registered your app. For example: https://localhost:33333
- AzureTenant: The Microsoft Online tenant being used to access data. Supply either a value in the form companyname.microsoft.com or the tenant ID.
The tenant ID is the same as the directory ID shown in the Azure Portal's Azure Active Directory > Properties page.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the HCL Domino JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.domino.jar
Fill in the connection properties and copy the connection string to the clipboard.
A typical JDBC URL is below:
jdbc:domino:Server=https://domino.corp.com;AuthScheme=OAuthPassword;User=my_domino_user;Password=my_domino_password;
Build the JDBC Foreign Data Wrapper
The Foreign Data Wrapper can be installed as an extension to PostgreSQL, without recompiling PostgreSQL. The jdbc2_fdw extension is used as an example (downloadable here).
- Add a symlink from the shared object for your version of the JRE to /usr/lib/libjvm.so. For example:
ln -s /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server/libjvm.so /usr/lib/libjvm.so
- Start the build:
make install USE_PGXS=1
Query HCL Domino Data as a PostgreSQL Database
After you have installed the extension, follow the steps below to start executing queries to HCL Domino data:
- Log into your database.
-
Load the extension for the database:
CREATE EXTENSION jdbc2_fdw;
-
Create a server object for HCL Domino:
CREATE SERVER Domino FOREIGN DATA WRAPPER jdbc2_fdw OPTIONS ( drivername 'cdata.jdbc.domino.DominoDriver', url 'jdbc:domino:Server=https://domino.corp.com;AuthScheme=OAuthPassword;User=my_domino_user;Password=my_domino_password;', querytimeout '15', jarfile '/home/MyUser/CData/CData\ JDBC\ Driver\ for\ Salesforce MyDriverEdition/lib/cdata.jdbc.domino.jar');
-
Create a user mapping for the username and password of a user known to the MySQL daemon.
CREATE USER MAPPING for postgres SERVER Domino OPTIONS ( username 'admin', password 'test');
-
Create a foreign table in your local database:
postgres=# CREATE FOREIGN TABLE byname ( byname_id text, byname_Name text, byname_Address numeric) SERVER Domino OPTIONS ( table_name 'byname');
postgres=# SELECT * FROM byname;