IBM Cloud Object Storage データにAqua Data Studio のVisual Query Builder やTable Data Editor からデータ連携。
CData JDBC Driver for IBM Cloud Object Storage は、Aqua Data Studio のようなIDE のウィザード・アナリティクスにIBM Cloud Object Storage データを統合します。本記事では、IBM Cloud Object Storage データをコネクションマネージャーに接続してクエリを実行する手順を説明します。
JDBC Data Source の設定
コネクションマネージャーで、新しいJDBC データソースとして、接続プロパティ設定を行い、保存します。IBM Cloud Object Storage データがAqua Data Studio ツールから使えるようになります。
- Aqua Data Studio で、Server メニューから Register Server を選択します。
- Register Server フォームで、 'Generic - JDBC' コネクションを選びます。
- 次のJDBC 接続プロパティを設定します:
- Name:任意の名前、データソースの名前など。
- Driver Location:Browse ボタンをクリックして、インストールディレクトリのlib フォルダの cdata.jdbc.ibmcloudobjectstorage.jar ファイルを選択します。
- Driver:クラス名に cdata.jdbc.ibmcloudobjectstorage.IBMCloudObjectStorageDriver を入力。
- URL:jdbc:ibmcloudobjectstorage: から始まるJDBC URL を入力します。接続プロパティをカンマ区切りで書きます。接続プロパティの詳細は、ヘルプドキュメントを参照してください。一般的な接続文字列は:
jdbc:ibmcloudobjectstorage:ApiKey=myApiKey;CloudObjectStorageCRN=MyInstanceCRN;Region=myRegion;OAuthClientId=MyOAuthClientId;OAuthClientSecret=myOAuthClientSecret;
- 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.
- 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.
- 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.
- 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.
- Extracts the access token and authenticates requests.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
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:
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:
Cloud Object Storage CRN
If you have multiple accounts, you will need to specify the CloudObjectStorageCRN explicitly. To find the appropriate value, you can:
Connecting to Data
You can now set the following to connect to data:
When you connect, the connector completes the OAuth process.
IBM Cloud Object Storage データにクエリを実行
接続したテーブルにクエリを実行してみます。
