Workday JDBC Driver のリモート機能を使用し、データアクセス用のPostgreSQL エントリポイントを作成します。
インターネット上には、多くのPostgreSQL クライアントがあります。標準のドライバーからBI、アナリティクスツールまで、PostgreSQL はデータアクセスのための一般的なインターフェースです。 JDBC ドライバーを使用することで、簡単に任意の標準クライアントから接続できるPostgreSQL エントリポイントを作成できます。
Workday にPostgreSQL データベースとしてアクセスするには、CData JDBC Driver for Workday とJDBC foreign data wrapper (FDW) を使用します。ここでは、FDW をコンパイルしてインストールし、PostgreSQL サーバーからWorkday にクエリを実行します。
JDBC データソースとしてWorkday データに接続する
JDBC データソースとしてWorkday に接続するには、以下が必要です。
- Driver JAR path:
- JAR は、インストールディレクトリのlib サブフォルダにあります。
Driver class:
cdata.jdbc.workday.WorkdayDriver
- JDBC URL:
URL は、"jdbc:workday:" で始まり、セミコロンで区切られた名前と値の組み合わせで任意の接続プロパティを含めることができます。
To connect, there are three pieces of information required: Authentication, API URL, and WSDL URL.
Authentication
To authenticate, specify your User and Password. Note that you must append your Tenant to your User separated by an '@' character. For instance, if you normally log in with 'geraldg' and your Tenant is 'mycompany_mc1', then your User should be specified as 'geraldg@mycompany_mc1'.
API URL
The API URL may be specified either directly via APIURL, or it may be constructed from the Tenant, Service, and Host. The APIURL is constructed in the following format: <Host>/ccx/service/<Tenant>/<Service>.
WSDL URL
The WSDLURL may be specified in its entirety, or may be constructed from the Service and WSDLVersion connection properties. The WSDLURL is constructed in the following format: https://community.workday.com/sites/default/files/file-hosting/productionapi/<Service>/<WSDLVersion>/<Service>.wsdl
ビルトイン接続文字列デザイナ
JDBC URL の構成については、Workday JDBC Driver に組み込まれている接続文字列デザイナを使用してください。JAR ファイルのダブルクリック、またはコマンドラインからJAR ファイルを実行します。
java -jar cdata.jdbc.workday.jar
接続プロパティを入力し、接続文字列をクリップボードにコピーします。
以下は一般的なJDBC URL です。
jdbc:workday:User=myuser;Password=mypassword;Tenant=mycompany_gm1;Host=https://wd3-impl-services1.workday.com
JDBC FDW を構築する
FDW は、PostgreSQL を再コンパイルせずに、PostgreSQL の拡張機能としてインストールできます。例としてjdbc2_fdw 拡張子を使用します。
- ご使用のバージョンのJRE 共有オブジェクトから、/usr/lib/libjvm.so にシンボリックリンクを追加します。例:
ln -s /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server/libjvm.so /usr/lib/libjvm.so
- ビルドを開始する:
make install USE_PGXS=1
Workday データをPostgreSQL データベースとしてクエリする
拡張機能をインストールした後、以下のステップに従ってWorkday へのクエリの実行を開始します。
- データベースにログインします。
-
データベースの拡張機能をロードする:
CREATE EXTENSION jdbc2_fdw;
-
Workday のオブジェクトを作成する:
CREATE SERVER Workday FOREIGN DATA WRAPPER jdbc2_fdw OPTIONS ( drivername 'cdata.jdbc.workday.WorkdayDriver', url 'jdbc:workday:User=myuser;Password=mypassword;Tenant=mycompany_gm1;Host=https://wd3-impl-services1.workday.com', querytimeout '15', jarfile '/home/MyUser/CData/CData\ JDBC\ Driver\ for\ Salesforce MyDriverEdition/lib/cdata.jdbc.workday.jar');
-
MySQL デーモンに認識されているユーザーのユーザー名とパスワードのユーザーマッピングを作成します。
CREATE USER MAPPING for postgres SERVER Workday OPTIONS ( username 'admin', password 'test');
-
ローカルデータベースに外部テーブルを作成する:
postgres=# CREATE FOREIGN TABLE workers ( workers_id text, workers_Worker_Reference_WID text, workers_Legal_Name_Last_Name numeric) SERVER Workday OPTIONS ( table_name 'workers');
postgres=# SELECT * FROM workers;