Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Feed IBM Cloud Object Storage Data into FineReport
How to set IBM Cloud Object Storage data as a JDBC data source in FineReport.
The CData JDBC Driver for IBM Cloud Object Storage fully implements the JDBC standard and can provide IBM Cloud Object Storage data connectivity to a wide variety of BI, reporting, and ETL tools and custom applications. In this article, we explain how to set IBM Cloud Object Storage data as JDBC data source in FineReport and view IBM Cloud Object Storage data as a table in the Report Designer.
Set Up a JDBC Data Source of IBM Cloud Object Storage Data
Follow the instruction below to set IBM Cloud Object Storage data as a FineReport database connection.
- Copy the cdata.jdbc.ibmcloudobjectstorage.jar file from the lib folder in the CData JDBC Driver for IBM Cloud Object Storage installation directory to the lib folder of the FineReport installation directory. You will need to copy the cdata.jdbc.ibmcloudobjectstorage.lic file as well.
- From the Server tab, select Define Data Connection, click to add a new connection, and click JDBC.
Next we will set up the data connection definition in the window.
- Database: Others
- JDBC Driver: cdata.jdbc.ibmcloudobjectstorage.IBMCloudObjectStorageDriver
-
URL: A standard JDBC connection string using semicolon-separated connection properties.
Register a New Instance of Cloud Object Storage
If you do not already have Cloud Object Storage in your IBM Cloud account, follow the procedure below to install an instance of SQL Query in your account:
- Log in to your IBM Cloud account.
- Navigate to the page, choose a name for your instance and click Create. You will be redirected to the instance of Cloud Object Storage you just created.
Connecting using OAuth Authentication
There are certain connection properties you need to set before you can connect. You can obtain these as follows:
API Key
To connect with IBM Cloud Object Storage, you need an API Key. You can obtain this as follows:
- Log in to your IBM Cloud account.
- Navigate to the Platform API Keys page.
- On the middle-right corner click "Create an IBM Cloud API Key" to create a new API Key.
- In the pop-up window, specify the API Key name and click "Create". Note the API Key as you can never access it again from the dashboard.
Cloud Object Storage CRN
If you have multiple accounts, you will need to specify the CloudObjectStorageCRN explicitly. To find the appropriate value, you can:
- Query the Services view. This will list your IBM Cloud Object Storage instances along with the CRN for each.
- Locate the CRN directly in IBM Cloud. To do so, navigate to your IBM Cloud Dashboard. In the Resource List, Under Storage, select your Cloud Object Storage resource to get its CRN.
Connecting to Data
You can now set the following to connect to data:
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- ApiKey: Set this to your API key which was noted during setup.
- CloudObjectStorageCRN (Optional): Set this to the cloud object storage CRN you want to work with. While the connector attempts to retrieve this automatically, specifying this explicitly is recommended if you have more than Cloud Object Storage account.
When you connect, the connector completes the OAuth process.
- Extracts the access token and authenticates requests.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the IBM Cloud Object Storage JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.ibmcloudobjectstorage.jar
Fill in the connection properties and copy the connection string to the clipboard.
When you configure the JDBC URL, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing reports and visualizations.
A typical JDBC URL is below:
jdbc:ibmcloudobjectstorage:ApiKey=myApiKey;CloudObjectStorageCRN=MyInstanceCRN;Region=myRegion;OAuthClientId=MyOAuthClientId;OAuthClientSecret=myOAuthClientSecret;
- Click Connection pool attributes and set Test before getting connections to No.
Click Test connection to ensure you have configured the connection properly. With the connection to IBM Cloud Object Storage set up, you can use it as FineReport data source.
Select IBM Cloud Object Storage Data in the Report Designer.
- Click to add a new template data set and select DB query to open the database query window.
- Choose the JDBC connection that you created from the dropdown list.
- The IBM Cloud Object Storage entities will appear as tables on the left pane.
- Write a SELECT statement for the IBM Cloud Object Storage data tables and columns that you want to load.
- Click preview and data is shown as table.
With these simple steps, IBM Cloud Object Storage can be used as a JDBC data source in FineReport.