- ODBC Drivers
- Java JDBC Drivers
- ADO.NET Providers
- SQL SSIS Components
- BizTalk Adapters
- Excel Add-Ins
- Power BI Connectors
- Tableau Connectors
- PowerShell Cmdlets
- Delphi & C++Builder
- Data Sync
- API Server
Node.js でBusiness b-ridge を仮想MySQL データベースとしてクエリ
Node.js からBusiness b-ridge に対してMySQL データベースとしてクエリを実行。CData Connect Cloud を使って、MySQL インターフェースでBusiness b-ridge をクエリすることができます。この記事では、Connect Cloud で仮想Business b-ridge データベースを作成し、Node.js でBusiness b-ridge をクエリする連携方法を説明します。
CData Connect Cloud は、Business b-ridge データのクラウドto クラウドのインターフェースを仮想MySQL として提供し、Node.js からRDB のようにデータをSQL でクエリすることができます。CData Connect Cloud がNode.js から発行されるSQL クエリ(フィルタリングやJOIN も可能)をパースしてBusiness b-ridge に送り、Node.js アプリ にBusiness b-ridge からのデータを返します。インテリジェントなサーバーサイドプロセスで、多様なクエリをパフォーマンス良く利用できます。
Business b-ridge の仮想MySQL データベースを作成
CData Connect Cloud は、直観的なPoint-and-click インターフェースでデータソースへの接続およびAPI エンドポイント作成を行います。
- Connect Cloud にログインして、Databases をクリックします。
- 利用できるデータソースアイコンから"Business b-ridge" を選択します。
-
Business b-ridge に接続するために必要なプロパティを入力します。
When connecting to Business b-ridge, CompanyKey, ProjectKey, and SubscriptionKey are required.
To obtain the SubscriptionKey, follow the steps below:
- Log in to Business b-ridge API Protal and go to "Profile" in the "Your name" menu.
- In your subscription section click "Main Key" to retrieve their respective values.
Authenticate to Business b-ridge Account
Set the following connection properties to connect:
- CompanyKey: Set the Business b-ridge Company Key of the connection destination.
- ProjectKey: Set the Business b-ridge Project Key of the connection destination.
- SubscriptionKey: Set the value "Subscription Key".
- Test Database をクリックします。
- Privileges -> Add をクリックして、新しいユーザーを追加し、適切な権限を指定します。
これで、Business b-ridge の仮想データベースが作成でき、MySQL クライアントからの連携が可能になりました。
Business b-ridge データをNode.js からクエリ
以下のサンプルは、Node.js のMySQL モジュールからBusiness b-ridge への接続を定義し、クエリを実行します。以下の情報が必要です:
- Host nameかaddress、port:Connect Cloud のインスタンス名(myinstance.cdatacloud.net)とぽーt-(3306)です。
- Username およびpassword:Connect Cloud で登録された権限のあるユーザーおよびそのパスワード。
- Database name:Business b-ridge (businessbridgedb) のデータベース名。
Business b-ridge に接続して、以下のコードでクエリを実行します:
var mysql = require('mysql'); var fs = require('fs'); var connection = mysql.createConnection({ host : 'myinstance.cdatacloud.net', database : 'businessbridgedb', port :'3306', user : 'admin', password : 'password', ssl : { ca : fs.readFileSync('C:/certs/myCA.pem') } }); connection.connect(); connection.query('SELECT * FROM CDATA', function(err, rows, fields) { if (err) throw err; console.log(rows); }); connection.end();