Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Connect to HubDB Data in DigitalSuite Studio through RunMyProcess DSEC
Use Arkobi Digital's low-code cloud native platform RunMyProcess's DigitalSuite EnterpriseConnect (DSEC) to connect to HubDB.
The CData JDBC Driver for HubDB implements JDBC Standards and enables a applications ranging from BI to IDE to connect with HubDB. In this article, we describe how to connect to HubDB data from Arkobi Digital RunMyProcess's DSEC and connect to HubDB in RunMyProcess.
Setting up EnterpriseConnect Agent
Configure the EnterpriseConnect Agent following the EnterpriseConnect page in the RunMyProcess documentation.
Setting up JDBC Adapter
The JDBC Adapter section describes the steps to connect to RDBMS through JDBC. Follow the steps and open the JDBC.config file.
- Create a JSON entry for the CData JDBC Driver for HubDB, e.g.
HubDB = { "sqlDriver" : "...", "sqlSource" : "...", "sqlDriverPath" : "..." }
- Set the "sqlDriver" field to the Class name for the CData JDBC Driver, e.g.
cdata.jdbc.hubdb.HubDBDriver - Set the "sqlSource" field to a JDBC URL for connecting to HubDB, e.g.
jdbc:hubdb:AuthScheme=OAuth;OAuthClientID=MyOAuthClientID;OAuthClientSecret=MyOAuthClientSecret;CallbackURL=http://localhost:33333;InitiateOAuth=GETANDREFRESHBuilt-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the HubDB JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.hubdb.jar
Fill in the connection properties and copy the connection string to the clipboard.
There are two authentication methods available for connecting to HubDB data source: OAuth Authentication with a public HubSpot application and authentication with a Private application token.
Using a Custom OAuth App
AuthScheme must be set to "OAuth" in all OAuth flows. Be sure to review the Help documentation for the required connection properties for you specific authentication needs (desktop applications, web applications, and headless machines).
Follow the steps below to register an application and obtain the OAuth client credentials:
- Log into your HubSpot app developer account.
- Note that it must be an app developer account. Standard HubSpot accounts cannot create public apps.
- On the developer account home page, click the Apps tab.
- Click Create app.
- On the App info tab, enter and optionally modify values that are displayed to users when they connect. These values include the public application name, application logo, and a description of the application.
- On the Auth tab, supply a callback URL in the "Redirect URLs" box.
- If you're creating a desktop application, set this to a locally accessible URL like http://localhost:33333.
- If you are creating a Web application, set this to a trusted URL where you want users to be redirected to when they authorize your application.
- Click Create App. HubSpot then generates the application, along with its associated credentials.
- On the Auth tab, note the Client ID and Client secret. You will use these later to configure the driver.
Under Scopes, select any scopes you need for your application's intended functionality.
A minimum of the following scopes is required to access tables:
- hubdb
- oauth
- crm.objects.owners.read
- Click Save changes.
- Install the application into a production portal with access to the features that are required by the integration.
- Under "Install URL (OAuth)", click Copy full URL to copy the installation URL for your application.
- Navigate to the copied link in your browser. Select a standard account in which to install the application.
- Click Connect app. You can close the resulting tab.
Using a Private App
To connect using a HubSpot private application token, set the AuthScheme property to "PrivateApp."
You can generate a private application token by following the steps below:
- In your HubDB account, click the settings icon (the gear) in the main navigation bar.
- In the left sidebar menu, navigate to Integrations > Private Apps.
- Click Create private app.
- On the Basic Info tab, configure the details of your application (name, logo, and description).
- On the Scopes tab, select Read or Write for each scope you want your private application to be able to access.
- A minimum of hubdb and crm.objects.owners.read is required to access tables.
- After you are done configuring your application, click Create app in the top right.
- Review the info about your application's access token, click Continue creating, and then Show token.
- Click Copy to copy the private application token.
To connect, set PrivateAppToken to the private application token you retrieved.
- Log into your HubSpot app developer account.
- Set the "sqlDriverPath" field to the name of the CData JDBC Driver JAR file, e.g.
cdata.jdbc.hubdb.jar
Sample JDBC.config File
#DBAgent Configuration
HubDB = {"sqlDriver" : "cdata.jdbc.hubdb.HubDBDriver", "sqlSource" = "jdbc:hubdb:AuthScheme=OAuth;OAuthClientID=MyOAuthClientID;OAuthClientSecret=MyOAuthClientSecret;CallbackURL=http://localhost:33333;","sqlDriverPath" = "cdata.jdbc.hubdb.jar" }
Put the JDBC driver JAR file (cdata.jdbc.hubdb.jar) into the same directory as unified-adapter-[version].jar.
Note: Make sure to put the CData license file (cdata.jdbc.hubdb.lic) into the same directory. Since the license is generated based on the unique identifier of the machine where the product in installed, you will need an offline activation if you want to put the file on another machine.
Starting DigitalSuite EnterpriseConnect Agent
In Windows, start RunMyProcess DigitalSuite EnterpriseConnect Agent in Windows services. To start the application through command line, see Starting the EnterpriseConnect Agent in the RunMyProcess documents.
Starting the JDBC Adapter
Start the JDBC Adapter from runAdapter.bat. Once the Adapter is running, you can access the application through the agent address (e.g. 127.0.0.1:8080). Below is an example executing the command in Windows.
... > java -Djava.util.logging.config.file=./log.properties -cp lib/* org.runmyprocess.sec2.AdapterHandler :
2021-06-09 14:37:58|INFO|correlationId=|Searching for config file...
2021-06-09 14:37:58|INFO|correlationId=|Adapter Handler started with [JDBC] configuration
2021-06-09 14:37:59|INFO|correlationId=|agent address: 127.0.0.1:8080
2021-06-09 14:38:00.251:INFO::ConnectionThread: Logging initialized @1820ms to org.eclipse.jetty.util.log.StdErrLog
2021-06-09 14:38:00|INFO|correlationId=|onConnect() websocket connection between Agent and Adapter established
Once the DigitalSuite EnterpriseConnect Agent and JDBC Adapter are running, access http://localhost:(specified-port-number)/ through your browser to open the page shown below.
Check the availability of the JDBC Adapter using tools such as Postman or cURL. Here, we use Postman to send the HTTP POST request.
Configure the RequestHeader as follows:
Content-Type application/json
Configure the RequestBody as follows:
{
"protocol":"JDBC",
"data":{
"DBType":"HubDB",
"sqlUsername":"",
"sqlPassword":"",
"sqlStatement":"SELECT * FROM NorthwindProducts"
}
}
If the JDBC.config file contains credential information, sqlUsername and sqlPassword can be left empty. If you are not sure of the table name, you can retrieve the list of tables using the request SELECT * FROM sys_tables
The request is successful if the Status is 200 and the Body contains HubDB data in JSON format.
Connect to HubDB through DSEC Agent in DigitalSuite Studio
Create a DigitalSuite Studio project and then create a Provider in the project.
- URL: The URL for accessing JDBC Agent (e.g. http:localhost:8080/)
- Authentication Scheme: Login/password
- Login: The value from agent.user in the application.properties file
- Password: agent.password in the application.properties file
- Secured: Checked
- Use DigitalSuite EnterpriseConnect: Checked
- With domain: The value from agent.domain in application.properties file
Next, create a Connector in the Provider.
- Connector URL: Leave this empty
- Architecture: REST/XML-RPC
- Method: POST
- Result format: JSON
- Accept media type: application/json
- Character set: Automatic
- Content: Same as the Request body used in the JDBC Adapter
- Content type: application/json
The JSON data we used as the Request body in JDBC Adapter:
{
"protocol":"JDBC",
"data":{
"DBType":"HubDB",
"sqlUsername":"",
"sqlPassword":"",
"sqlStatement":"SELECT * FROM NorthwindProducts"
}
}
Open Launch Test to perform the test. The test is successful if HubDB data is shown in Result on the right pane.
Now you can use HubDB data in RunMyProcess DigitalSuite Studio through DSEC.
For the detailed information on supported SQL commands, refer to the SQL Compliance section in our help documentation. For information on tables, refer to the Data Model section.