JDBC Driver for Paylocity

Build 22.0.8462

Establishing a Connection

Creating a JDBC Data Source

You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for Paylocity consists of three basic steps:

  • Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
  • Provide the driver class. For example:
    cdata.jdbc.paylocity.PaylocityDriver
  • Provide the JDBC URL. For example:
    jdbc:paylocity:InitiateOauth=GETANDREFRESH;OAuthClientID=YourClientId;OAuthClientSecret=YourClientSecret;RSAPublicKey=YourRSAPubKey;Key=YourKey;IV=YourIV;
    
    or
    
    jdbc:cdata:paylocity:InitiateOauth=GETANDREFRESH;OAuthClientID=YourClientId;OAuthClientSecret=YourClientSecret;RSAPublicKey=YourRSAPubKey;Key=YourKey;IV=YourIV;

    The second format above can be used whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:paylocity:" or "jdbc:cdata:paylocity:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to Paylocity

Set the following to establish a connection to Paylocity:

  • RSAPublicKey: Set this to the RSA Key associated with your Paylocity, if the RSA Encryption is enabled in the Paylocity account.

    This property is required for executing Insert and Update statements, and it is not required if the feature is disabled.

  • UseSandbox: Set to true if you are using sandbox account.
  • CustomFieldsCategory: Set this to the Customfields category. This is required when IncludeCustomFields is set to true. The default value for this property is PayrollAndHR.
  • Key: The AES symmetric key(base 64 encoded) encrypted with the Paylocity Public Key. It is the key used to encrypt the content.

    Paylocity will decrypt the AES key using RSA decryption.
    It is an optional property if the IV value not provided, The driver will generate a key internally.

  • IV: The AES IV (base 64 encoded) used when encrypting the content. It is an optional property if the Key value not provided, The driver will generate an IV internally.

OAuth

You must use OAuth to authenticate with Paylocity. OAuth requires the authenticating user to interact with Paylocity using the browser. For more information, refer to Using OAuth Authentication.

The Pay Entry API

The Pay Entry API is completely seperate from the rest of the Paylocity API. It uses a seperate Client ID and Secret, and must be explicitly requested from Paylocity for access to be granted for an account. The Pay Entry API allows you to automatically submit payroll information for individual employees, and little else. Due to the extremely limited nature of what is offered by the Pay Entry API, we have elected not to give it a seperate schema, but it may be enabled via the UsePayEntryAPI connection property.

Please be aware that when setting UsePayEntryAPI to true, you may only use CreatePayEntryImportBatch, MergePayEntryImportBatch, Input_TimeEntry, and the OAuth stored procedures. Attempts to use other features of the product will result in an error. You must also store your OAuthAccessToken seperately, which often means setting a different OAuthSettingsLocation when using this connection property.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462