Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Connecting Java and Sail with ADBC

Instructions

This example uses Sail, a fast query engine that supports Arrow Flight SQL.

Tip

If you already have a Sail Flight SQL server running, skip the steps to set up Sail.

Prerequisites

  1. Install Maven

  2. Install uv

  3. Install dbc

Set up Sail

  1. Install Sail:

    uv tool install pysail
  2. Start the Sail Flight SQL server:

    sail flight server --ip 127.0.0.1 --port 32010

Connect to Sail

  1. Install the Flight SQL ADBC driver:

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

    • Change the connection arguments in the params.put() calls
      • uri is the URI of your Sail Flight SQL server. The host and port will depend on your installation (the default port is 32010). The protocol scheme should be grpc for plain connections or grpc+tls if your server is configured with TLS.
    • Change the SQL SELECT statement in stmt.setSqlQuery() if desired
  3. Run the Java program:

    mvn compile exec:exec

    The output will look something like this:

    result
    2
    

Clean up

Stop the Sail Flight SQL server by pressing Ctrl-C in the terminal where it is running.