Ready to get started?

Download a free trial of the Workday Driver to get started:

 Download Now

Learn more:

Workday Icon Workday JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with Workday.

A PostgreSQL Interface for Workday Data



Use the Remoting features of the Workday JDBC Driver to create a PostgreSQL entry-point for data access.

There are a vast number of PostgreSQL clients available on the Internet. From standard Drivers to BI and Analytics tools, PostgreSQL is a popular interface for data access. Using our JDBC Drivers, you can now create PostgreSQL entry-points that you can connect to from any standard client.

To access Workday data as a PostgreSQL database, use the CData JDBC Driver for Workday and a JDBC foreign data wrapper (FDW). In this article, we compile the FDW, install it, and query Workday data from PostgreSQL Server.

Connect to Workday Data as a JDBC Data Source

To connect to Workday as a JDBC data source, you will need the following:

  • Driver JAR path: The JAR is located in the lib subfolder of the installation directory.
  • Driver class: cdata.jdbc.workday.WorkdayDriver

  • JDBC URL: The URL must start with "jdbc:workday:" and can include any of the connection properties in name-value pairs separated with semicolons.

    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

    Built-in Connection String Designer

    For assistance in constructing the JDBC URL, use the connection string designer built into the Workday JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

    java -jar cdata.jdbc.workday.jar

    Fill in the connection properties and copy the connection string to the clipboard.

    A typical JDBC URL is below:

    jdbc:workday:User=myuser;Password=mypassword;Tenant=mycompany_gm1;Host=https://wd3-impl-services1.workday.com

Build the JDBC Foreign Data Wrapper

The Foreign Data Wrapper can be installed as an extension to PostgreSQL, without recompiling PostgreSQL. The jdbc2_fdw extension is used as an example (downloadable here).

  1. Add a symlink from the shared object for your version of the JRE to /usr/lib/libjvm.so. For example: ln -s /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server/libjvm.so /usr/lib/libjvm.so
  2. Start the build: make install USE_PGXS=1

Query Workday Data as a PostgreSQL Database

After you have installed the extension, follow the steps below to start executing queries to Workday data:

  1. Log into your database.
  2. Load the extension for the database: CREATE EXTENSION jdbc2_fdw;
  3. Create a server object for 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');
  4. Create a user mapping for the username and password of a user known to the MySQL daemon. CREATE USER MAPPING for postgres SERVER Workday OPTIONS ( username 'admin', password 'test');
  5. Create a foreign table in your local database: 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');
You can now execute SELECT commands to Workday: postgres=# SELECT * FROM workers;