製品をチェック

無償トライアル:

無償トライアルへ

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

ShipStation JDBC Driver

ShipStation データに連携するJava アプリケーションを素早く、簡単に開発できる便利なドライバー。

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

お問い合わせ

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


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


shipstation ロゴ画像
jdbc ロゴ画像

JDBC

Jetty ロゴ画像

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

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

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

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

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

    <Configure id='shipstationdemo' class="org.eclipse.jetty.webapp.WebAppContext"> <New id="shipstationdemo" class="org.eclipse.jetty.plus.jndi.Resource"> <Arg><Ref refid="shipstationdemo"/></Arg> <Arg>jdbc/shipstationdb</Arg> <Arg> <New class="cdata.jdbc.shipstation.ShipStationDriver"> <Set name="url">jdbc:shipstation:</Set> <Set name="APIKey">'YourAPIKey'</Set> <Set name="APISecret">'YourAPISecret'</Set> </New> </Arg> </New> </Configure>

    Use the BASIC Authentication standard to connect.

    1. Login to your ShipStation account
    2. Click on the settings icon in the upper right corner. A column menu will show up on the left
    3. Click Account -> API Settings
    4. On the API Settings page, note the API Key and API Secret.

    Authenticating to ShipStation

    • APIKey: Set this to the API key from the API settings page.
    • APISecret: Set this to the Secret key from the API settings page.
  4. Web xml でリソースを設定します:

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

Jetty にさらに統合

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