製品をチェック

無償トライアル:

無償トライアルへ

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

ADP JDBC Driver

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

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

お問い合わせ

Jetty コネクションプールからADP データに連携。


CData JDBC Driver for ADP は、コネクションプーリングをサポートします:本記事では、Jetty のWeb アプリからADP データに連携する手順を説明します。


adp ロゴ画像
jdbc ロゴ画像

JDBC

Jetty ロゴ画像

CData JDBC Driver for ADP は、Java Web アプリケーションに簡単に統合して利用することができます。本記事では、Jetty でドライバーをコネクションプールとして設定することで、効率的にADP データをアプリケーションで連携利用する方法を説明します。Jetty でJNDI resource for ADP を設定します。

DBC Driver for ADP を JNDI Data Source として設定

次の手順で、Jetty とADP の接続を確立します。

  1. Jetty ベースでJNDI モジュールを有効化します。JNDI を有効化するコマンドラインは以下の通り:

    java -jar ../start.jar --add-to-startd=jndi
  2. JDBC Driver の.jar ファイルと.lic ファイル(インストールディレクトリのlib フォルダ下)をcontext path のlib フォルダに配置します。
  3. リソースおよびスコープを宣言します。リソース宣言で必要な接続プロパティを入力します。この例では、ADP データソースをWeb アプリケーションのWEB-INF\jetty-env.xml レベルにdeclare しています。

    <Configure id='adpdemo' class="org.eclipse.jetty.webapp.WebAppContext"> <New id="adpdemo" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg><Ref refid="adpdemo"/></Arg> <Arg>jdbc/adpdb</Arg> <Arg> <New class="cdata.jdbc.adp.ADPDriver"> <Set name="url">jdbc:adp:</Set> <Set name="OAuthClientId">YourClientId</Set> <Set name="OAuthClientSecret">YourClientSecret</Set> <Set name="SSLClientCert">'c:\cert.pfx'</Set> <Set name="SSLClientCertPassword">'admin@123'</Set> </New> </Arg> </New> </Configure>

    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.

  4. Web xml でリソースを設定します:

    jdbc/adpdb javax.sql.DataSource Container
  5. これで、java:comp/env/jdbc/adpdb へのルックアップでADP データにアクセスできます: InitialContext ctx = new InitialContext(); DataSource myadp = (DataSource)ctx.lookup("java:comp/env/jdbc/adpdb");

Jetty にさらに統合

ここでは、シンプルなコネクションプーリングシナリオでのドライバーの接続について説明しました。追加での連携ケースについては、Jetty ドキュメントのWorking with Jetty JNDI  参照してください。