JDBC

JDBC drivers power many traditional data tools, such as SQL Editors, BI and Visualization tools, ETL tools, and more. Space and Time Managed DB provides a JDBC driver for wide adoption of those traditional tools.

📘

These instructions walk you through connecting to Space and Time Managed DB via the open-source SQL editor DBeaver. The steps will vary slightly depending on your SQL editor, but the general concepts are the same.

Requirements

  • Download the latest version of the SxT JDBC driver jar and save it somewhere on your local disk, for example, under the "Applications" or "Program Files" directory. There are two files included:
    • jdbc-driver-X.Y.Z.jar
    • jdbc-driver-X.Y.Z.pom
      Standard use-cases only require the .jar file, the .pom file can be ignored.
  • Download DBeaver(or another SQL editor or choice)

Set up the JDBC Driver

Step 1: Add a new driver

Add the .jar file as a new driver in your SQL editor. How you do this depends on the tool - below outlines instructions for DBeaver, but most tools will be somewhat similar.

DBeaver instructions:

  • Open the "Database Menu" → "Driver Manager" → "New"
  • Select the "Libraries" tab and "Add File"
  • Navigate to the SxT JDBC driver .jar file linked in the Requirements section above
  • Once you have the .jar file selected, click on the "Find Class" button and select Driver Class io.spaceandtime.jdbc.JdbcDriver. If the Find Class button doesn't work, try saving the connection first, then returning and hitting Find Class again.
  • Hit "Ok" to save the new library and settings

Step 2: Configure the driver properties

Setting up the driver requires two driver properties:

  • Class Name: io.spaceandtime.jdbc.JdbcDriver
  • URL Template: jdbc:sxt:thin://{host}
    The {host} will be replaced by the **host ** field when setting up new connections.

The driver setup screen should look something like this:

Step 3: Create a new connection

Once the driver is setup, you can create a new connection. Again, this will vary depending on the tool used, however there are a few pieces of information you will need.

There are two ways you can use the JDBC driver to authenticate: username/password thru the Dreamspace Gateway (Secrets Proxy) or connecting directly to the Decentralized Network using public/private keypair. For either approach, the above connection setup information remains the same.

Connect via Gateway (Secrets Proxy)

This is the most straight forward, as it leverages the username and password from Dreamspace. Simply add your Dreamspace UserName and Password in the supplied JDBC setup screen, and you're done!

Connect with Decentralized Network:

If authenticating with the decentralized network, you will need to provide your public / private keypair. When entering this information into the JDBC connection, you will need to enter your keypair as "Driver Properties":

  • publicKey - This will be the public key corresponding to the below private key. Please note publicKey needs to be configured manually, as this field does not exist by default. Click on "add user property" and enter publicKey exactly as shown, as both the name and values are case sensitive.
  • privateKey - This will be the private key corresponding to the above public key. Please note privateKey needs to be configured manually, as this field does not exist by default. Click on "add user property" and enter privateKey exactly as shown, as both the name and values are case sensitive.
  • Both public and private keys need to be in base64 encoding, which is also case sensitive.

📘

The user's private key NEVER leaves the JDBC driver/user's computer. Rather, the private key is used to generate a cryptographic signature that allows Space and Time servers to validate key ownership without transmitting the key itself.

Step 4: Test your connection

Before continuing, test your connection to ensure all properties were entered correctly.

DBeaver instructions:

  • Select the "Test Connection" in the lower lefthand corner of the configuration screen

About Accessing and Permissioning Resources (Biscuits)

Space and Time use biscuits to manage the secure authorization between users and tables on a decentralized network. Establishing this authorization requires one additional step for the JDBC driver: add a biscuit to the JDBC driver properties. For a guide on how to do so, see this page.