Using the Kognitio JDBC Driver

The Kognitio JDBC driver is a type 4 JDBC driver that provides direct access to a Kognitio server cluster. It can be downloaded here.

The driver implements version 4.1 of the JDBC API and does not require a JDBC-ODBC bridge or any ODBC setup on the client system.

Prerequisites

  • The Kognitio server you are connecting to must be version 8.1 or later.
  • The Java Runtime Environment (JRE) must be version 1.7 (Java 7) or later.
  • The JDBC driver connects to port 6550 (by default) on one of the cluster nodes (or the edge node for Hadoop) and the rules for any firewalls must be configured appropriately.

Installation and connection

Download and add to application

Download the Kognitio JDBC driver and add it to your application. How this is done varies by application and you should consult the application documentation for details. It typically involves copying the KognitioJDBC.jar file to a specific loacation and / or setting a configuration parameter identifying it’s location.

Set the driver class

The driver class is com.kognitio.jdbc.Driver and most applications will need to have this configured somewhere.

Configure the connection URL

The connection URL is the main configuration item and is a string identifying the connection scheme (jdbc:kognitio:) plus some mandatory and some optional options. It’s format is:

jdbc:kognitio://serveraddress[:port][;option1=value1;option2=value2;...]

serveraddress is mandatory and it should be the IP address or domain name of one of the server clusters nodes except on Hadoop where it needs to be the address of the edge node.

From release 8.2.0rel170810, for non-Hadoop deployments, multiple addresses may be specified separated by commas or as ranges of addresses in square brackets. In this case, the driver will start with a random address from the list and iterate through it until it successfully connects or until it has tried every address (see examples below).

:port is optional and if omitted will default to port 6550. Most systems use the default port but on Hadoop, systems with multiple clusters need a unique port number for every cluster.

options are added to the URL as ;option=value pairs and can be used to set the following connection options:

Connection URL options
Option Type Default Description
loglevel Java logging level INFO Specify log detail level, if logpath is set. The valid values, in ascending order of verbosity, are OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, and ALL.
logpath string (not set) If set, write debug information for this connection to the specified log file.
randomserveraddress true/false true If a list of addresses is given, then if set to true, start from a random address in the list. If set to false, start from the first address in the list.
requestencryption true/false true Attempt to set up an SSL session to encrypt client-server traffic. N.B. With Java 1.8 onwards, the JDBC driver cannot make SSL sessions with servers older than version 8.2.
requireencryption true/false false If SSL cannot be set up, fail to connect rather than fall back to an unencrypted connection.
timeout integer 0 Time out if it takes longer than this many seconds to establish a TCP connection to the server. If the value is 0, or anything other than a positive integer, no timeout is enforced

Example connection URLs

  • To connect to 172.30.11.10:

jdbc:kognitio://172.30.11.10

  • To connect to 172.30.11.10, timing out if we can’t make a connection in 10 seconds:

jdbc:kognitio://172.30.11.10;timeout=10

  • Three ways to connect to a server which has four adjacent IP addresses, trying each one in turn:

jdbc:kognitio://172.30.21.1,172.30.21.2,172.30.21.3,172.30.21.4

jdbc:kognitio://172.30.21.[1,2,3,4]

jdbc:kognitio://172.30.21.[1-4]

  • To connect to devedge01 on port 6551:

jdbc:kognitio://devedge01:6551

  • To connect to 172.30.11.10, but cause the connection to fail if SSL encryption cannot be set up:

jdbc:kognitio://172.30.11.10;requireencryption=true

  • Shorthand notation to connect to a server with addresses 10.0.0.1, 10.0.0.3, 10.0.0.6, 10.0.0.7, 10.0.0.8 and 10.0.0.11:

jdbc:kognitio://10.0.0.[1,3,6-8,11]

  • Connect to server listening on a range of ports

jdbc:kognitio://10.0.0.1:[6550-6553]