Establishing a Connection
Creating a JDBC Data Source
You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Domino consists of three basic steps:
- Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
- Provide the driver class. For example:
cdata.jdbc.domino.DominoDriver
- Provide the JDBC URL. For example:
jdbc:domino:URL=http://dominoserver:3002/;DataSource=names;TableTypes=Tables;AuthScheme=OAuthPassword;User=MyUser;Password=MyPassword; or jdbc:cdata:domino:URL=http://dominoserver:3002/;DataSource=names;TableTypes=Tables;AuthScheme=OAuthPassword;User=MyUser;Password=MyPassword;
The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:domino:" or "jdbc:cdata: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 to Domino
Domino supports authenticating via login credentials or an Azure Active Directory OAuth application:
Login Credentials
Set AuthScheme to OAuthPassword and set the following properties:- 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 here.Set AuthScheme to AzureAD and set the following properties:
- 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.