製品をチェック

無償トライアル:

無償トライアルへ

製品の情報と無償トライアルへ:

ADP JDBC Driver

ADP 連携のパワフルなJava アプリケーションを素早く作成して配布。

データ連携でお困りですか?

お問い合わせ

PowerBuilder からADP データに連携


この記事では、ADP JDBC ドライバーを使用してPowerBuilder からADP にアクセスする方法を説明します。


加藤龍彦
ウェブデベロッパー

CData JDBC Driver for ADP は、標準ベースのコントロールであり、PowerBuilder を含むJDBC をサポートするプラットフォームまたは開発テクノロジーから使用できます。 また、PowerBuilder でCData JDBC Driver for ADP を使用する方法についても詳しく説明します。

この記事では、CData JDBC Driver for ADP を使用して読み取りと書きこみを実行する基本的なPowerBuilder アプリケーションを作成する方法を説明します。

PowerBuilder からADP データに接続

以下のステップに従ってDatabase Painter ツールを使用し、JDBC URL for ADP に基づいてデータベースプロファイルを作成します。データベースプロファイルを使用して、接続プロパティを保存できます。Ⅾatabase Painter では、データをグラフィカルに操作したり、SQL クエリを実行したりできます。

  1. ドライバーJAR をPowerBuilder クラスパスに追加します。CLASSPATH システム環境変数を、インストールディレクトリのlib サブフォルダにあるドライバーJAR へのパスに設定します。

    NotePowerBuilder Classic を使用している場合は、[Tools]->[System Options]->[Java]をクリックし、ドライバーJAR へのパスを追加することもできます。

  2. [Tools]->[Database Painter]と進みます。
  3. JDBC のノードを右クリックし、[New Profile]をクリックします。
  4. [Database Profile Setup]ダイアログで、以下を入力します。
    • Profile Name:プロファイルのわかりやすい名前を入力します。
    • Driver Name:ドライバーのクラス名にcdata.jdbc.adp.ADPDriver を入力します。
    • URL:JDBC URL を入力します。

      Connect to ADP by specifying the following properties:

      • SSLClientCert: Set this to the certificate provided during registration.
      • SSLClientCertPassword: Set this to the password of the certificate.
      • UseUAT: The connector makes requests to the production environment by default. If using a developer account, set UseUAT = true.
      • RowScanDepth: The maximum number of rows to scan for the custom fields columns available in the table. The default value will be set to 100. Setting a high value may decrease performance.

      The connector uses OAuth to authenticate with ADP. OAuth requires the authenticating user to interact with ADP using the browser. For more information, refer to the OAuth section in the Help documentation.

      ビルトイン接続文字列デザイナ

      JDBC URL の構成については、ADP JDBC Driver に組み込まれている接続文字列デザイナを使用してください。JAR ファイルのダブルクリック、またはコマンドラインからJAR ファイルを実行します。

      java -jar cdata.jdbc.adp.jar

      接続プロパティを入力し、接続文字列をクリップボードにコピーします。以下は一般的なJDBC URL です。

      jdbc:adp:OAuthClientId=YourClientId;OAuthClientSecret=YourClientSecret;SSLClientCert='c:\cert.pfx';SSLClientCertPassword='admin@123'InitiateOAuth=GETANDREFRESH
    The JDBC data source defined in the Database Profile Setup dialog.(Salesforce is shown.)
  5. テーブルを表示および編集するには、テーブルを右クリックして[Edit Data]->[Grid]をクリックします。
Modify database objects in the Database Painter.(Salesforce is shown.)

ADP をPowerBuilder Controls と共に使用する

標準のPowerBuilder オブジェクトを使用してJDBC データソースに接続し、クエリを実行できます。以下の例は、ADP をDataWindowに取得する方法を示しています。次のコードをopen メソッドに追加できます。

SQLCA.DBMS = "JDBC" SQLCA.AutoCommit = False SQLCA.DBParm = "Driver='cdata.jdbc.adp.ADPDriver',URL='jdbc:adp:OAuthClientId=YourClientId;OAuthClientSecret=YourClientSecret;SSLClientCert='c:\cert.pfx';SSLClientCertPassword='admin@123'InitiateOAuth=GETANDREFRESH"; CONNECT USING SQLCA; dw_workers.SetTransObject(SQLCA); dw_workers.Retrieve();