Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Connecting Java and Exasol with ADBC

Instructions

Tip

If you already have an Exasol instance running, skip the steps to run Exasol in a Docker container.

Prerequisites

  1. Install Maven

  2. Install dbc

Set up Exasol

  1. Install Docker

Warning

The Exasol Docker image may not work with Docker for Windows or Docker for macOS. On macOS, we have found that Colima's x86_64 emulation may work better. Alternatively, consider Exasol Personal running in the cloud.

  1. Start Exasol in a Docker container (documentation):

    docker run \
       -p 127.0.0.1:9563:8563 \
       --name exasol \
       --privileged \
       --detach \
       exasol/docker-db:latest-2025.1
  2. Create a table in Exasol and load data into it:

    docker cp games.sql exasol:/tmp/games.sql
    docker cp load-data.sh exasol:/tmp/load-data.sh
    docker exec exasol bash /tmp/load-data.sh

Connect to Exasol

  1. Install the Exasol ADBC driver:

    dbc install exasol
  2. Customize the main method in Example.java

    • Change the connection arguments in the params.put() calls
      • Change uri as needed, using query parameters to add more connection arguments, or keep it as is to use the data included with this example
    • If you changed which schema you're opening, also change the SQL SELECT statement in stmt.setSqlQuery()
  3. Run the Java program:

    mvn compile exec:exec

Clean up

  1. Stop the Docker container running Exasol:

    docker stop exasol
    docker rm exasol