Advanced Database Integration

If integrating with a JDBC interfacing database, such as DB2, you will need to host a basic Whitelisted Proxy or Functionize Tunnel Service to facilitate the communication between the Functionize Runtime environment and your database. This service will need to be set up in an environment where it can communicate directly with the database.

When using this configuration, the service that you install exposes a single endpoint to act as a passthrough to the database.

DB_Integration.png

Whitelist Proxy

For this configuration, Functionize will provide you with a Proxy that can be whitelisted in your DMZ to allow access to the Functionize DB service host that will in turn route the database queries to the appropriate database.

Functionize Tunnel

For this configuration, we will provide you with a Proxy to the Functionize WSS Tunnel endpoint to allow access to the Functionize DB service host that will in turn route the database queries to the appropriate database. The Java JAR file to host the DB Service can be run on the same system where the Tunnel is running.

Prerequisites

A minimum of Java 21 must be installed and Java needs to be added in the system path.

Manual run (no installation)

  1. Download the .jar file needed for all databases here.
  2. Test connectivity from the server where you would like to host the service
    • The service can be run temporarily from the command line
      java -jar functionize_databaseConnectivity.jar 
    • You can use the curl command at the end of the article to test connectivity.
      Note: The curl command for Oracle must include the Site Identifier or SID parameter.
  3. Once connectivity is verified, install as a service. Instructions to install as a Linux service are available upon request.

Windows Installation

  1. Download and run the Windows installer from here.

Linux Installation

  1. Download JAR file from here.
  2. Create a service that runs the following command:
    java -jar /path/to/jar/file/functionize_database_connectivity_v151.jar>> /path/to/log/file/filename.log 2>&1 &
    • Don’t forget to update the above command with the proper paths

Docker installation

Authentication token will be created and sent by Functionize. To pull the image, the system downloading the image has to authenticate to the repository:

  1. Login to Artifact Registry was tested as follows: cat customer-key-name-here.json.b64 | docker login -u _json_key_base64 --password-stdin us-central1-docker.pkg.dev/functionize-customer
  2. Run the following: docker pull  us-central1-docker.pkg.dev/functionize-customer/dbconnector/dbconnector:latest

Kubernetes Installation

NOTE: The steps below should be used as a general guide, please modify the instructions as needed for your environment. The authentication token will be created and sent by Functionize. To pull the image, the system downloading the image has to authenticate to the repository:

  1. Copy the contents of the provided .b64 file
  2. Create kubernetes secret:

    kubectl create secret generic gcp-key \
      --from-literal=key.json=<PASTE_BASE64_STRING_HERE>
  3. Establish a service account:

    kubectl create serviceaccount functionize-dbconnector-sa
    kubectl create secret docker-registry artifact-registry-creds \
      --docker-server=us-central1-docker.pkg.dev \
      --docker-username=_json_key_base64 \
      --docker-password="$(kubectl get secret gcp-key -o jsonpath='{.data.key\.json}' | base64 -d)" 
    kubectl patch serviceaccount functionize-dbconnector-sa \
      -p '{"imagePullSecrets": [{"name": "artifact-registry-creds"}]}'
  4. Deploy container using a deployment yaml. 
    • See sample from here.

Drivers Available

  • For MSSQL: com.microsoft.sqlserver.jdbc.SQLServerDriver
  • For Oracle: oracle.jdbc.driver.OracleDriver
  • For DB2 (JDBC4 specification): com.ibm.db2.jcc.DB2Driver
  • For PostgreSQL: org.postgresql.Driver
  • For mariaDB: org.mariadb.jdbc.Driver
  • For MySQL (JDBC): com.mysql.cj.jdbc.Driver
  • For InfluxDB: com.dbschema.influxdb.InfluxJdbcDriver

Connectivity Test Command

curl -H "Content-Type: application/json" -X POST -d '{"sql":"DB_QUERY", "name":"DB_USER_NAME", "password":"DB_USER_PASSWORD", "dbname":"DB_NAME","server":"DB_SERVER_ADDRESS", "dbport": "DB_SERVER_PORT" , "driver":"DB_DRIVER" , "sid": "SITEID"}' http://ADDRESS_OF_SERVICE:2511/query