製品をチェック

無償トライアル:

無償トライアルへ

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

ShipStation JDBC Driver

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

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

お問い合わせ

JRuby からShipStation にデータ連携


リアルタイムShipStation に連携するシンプルなJRuby アプリケーションを作成します。


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

shipstation ロゴ画像

JDBC Driver

jdbc ロゴ画像
JRuby ロゴ画像

JRuby はRuby プログラミング言語の高性能で安定した、完全にスレッド化されたJava 実装です。CData JDBC Driver for ShipStation を使用すると、JRuby からリアルタイムShipStation へのデータ連携を簡単に実装できます。ここでは、ShipStation に接続し、クエリを実行して結果を表示する簡単なJRuby アプリを作成する方法を説明します。

ShipStation データにJDBC で接続

アプリを作成する前に、JDBC Driver のJAR ファイルのインストール場所をメモします。 (通常はC:\Program Files\CDatat\CData JDBC Driver for ShipStation\libにあります。)

JRuby は、JDBC をネイティブにサポートしているため、簡単にShipStation に接続してSQL クエリを実行できます。java.sql.DriverManager クラスのgetConnection 関数を使用してJDBC 接続を初期化します。

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.

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

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

java -jar cdata.jdbc.shipstation.jar

接続プロパティを入力し、接続文字列をクリップボードにコピーします。

Using the built-in connection string designer to generate a JDBC URL (Salesforce is shown.)

以下はShipStation の一般的なJDBC 接続文字列です。

jdbc:shipstation:APIKey='YourAPIKey';APISecret='YourAPISecret'

ShipStation データへの接続性を持つJRuby アプリを作成

新しいRuby ファイル(例: ShipStationSelect.rb) を作成してテキストエディタで開き、次のコードをファイルにコピーします。

require 'java' require 'rubygems' require 'C:/Program Files/CData/CData JDBC Driver for ShipStation 2018/lib/cdata.jdbc.shipstation.jar' url = "jdbc:shipstation:APIKey='YourAPIKey';APISecret='YourAPISecret'" conn = java.sql.DriverManager.getConnection(url) stmt = conn.createStatement rs = stmt.executeQuery("SELECT Id, Color FROM Tags") while (rs.next) do puts rs.getString(1) + ' ' + rs.getString(2) end

ファイルが完成したら、コマンドラインからファイルを実行するだけでJRuby でShipStation を表示できるようになります。

jruby -S ShipStationSelect.rb

SQL-92 クエリをShipStation に書き込むと、ShipStation を独自のJRuby アプリケーションに素早く簡単に組み込むことができます。今すぐ無料トライアルをダウンロードしましょう。