Skip to content

eXate PostgreSQL JDBC Driver

Installing the Driver

To install the eXate custom PostgreSQL JDBC driver, add the following dependency to your Maven pom.xml file:

<dependency>
  <groupId>com.exate</groupId>
  <artifactId>postgresql</artifactId>
  <version>X.XX</version>
</dependency>

Repository Configuration

The driver is hosted on an Azure Artifacts Maven feed. You need to configure your Maven repository settings to include the following:

<repository>
  <id>eXate-Maven</id>
  <url>https://pkgs.dev.azure.com/exatetechnology/data-science/_packaging/{YOUR_FEED}/maven/v1</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

Your project will be provided with a specific feed URL and access token.

Authentication

To use the driver, a JWT token must be available for authentication. The token can be provided in two ways:

1. Environment Variable

Set the EXATE_TOKEN environment variable in the environment where the JDBC driver is running:

export EXATE_TOKEN=your_jwt_token_here

2. Query-Level Token

Alternatively, the token can be included in the SQL query as a comment:

-- EXATE_TOKEN: your_jwt_token_here
SELECT * FROM db.public."table1";

3. For Denodo Users

Denodo users can use the Init SQL statements feature in the datasource configuration to pass the SET query with an interpolation variable.

SET SESSION EXATE_TOKEN TO @{your_jwt_token_here}

The token passed via either Init SQL statements or Query-Level Token will always have precedence over the token set via Environment Variables.

Configuring the Driver

Setting the API Gateway URI

The driver must communicate with the ApiGator pod to perform encryption and decryption. Configure the apigator.uri as a driver property in JDBC clients like DBeaver or Denodo.

Alternatively, you can configure the APIGATOR_URI environment variable with the appropriate URI:

export APIGATOR_URI=your-apigator-endpoint

To supply a port, simply append the URI with a colon and the port:

export APIGATOR_URI=your-apigator-endpoint:port

If no port is supplied, the driver will default to the default TLS port 443.

The apigator.uri set in the driver properties will always have precedence. If no URI is specified, it defaults to localhost.
We do not need to provide a protocol explicitly like http:// or https://. The driver only connects to APIgator over TLS.

Setting Additional Claims

Claims are extracted from the provided JWT token, but additional claims can be set using the MATCHING_RULES environment variable. The value should be a JSON array of attribute mappings:

export MATCHING_RULES='[{"attributeName":"a","attributeValue":"a"}, {"attributeName":"b","attributeValue":"b"}]'

Entitlements

For any table that requires encryption or decryption, an eXate Datagator entitlement must be created. The entitlement should be named using the following format:

{database_name}.{schema_name}

Columns that match defined attributes will be:

  • Encrypted on INSERT and UPDATE operations.
  • Decrypted on SELECT queries.

Refer to the eXate User Guide for more details on configuring entitlements within eXate Datagator.

Querying Encrypted Data

Exact Match Searches

If you need to query an encrypted column, exact match searches are supported:

SELECT * FROM db.public."table1" WHERE "COMPANY_NAME" = 'EXATE';

Unsupported Queries

Other search types, such as partial matches (LIKE or ILIKE), are not supported for encrypted columns.


For more information, refer to the official eXate documentation or contact support.