Tip
If you already have a Trino instance running, skip the steps to run Trino in a Docker container.
-
Start Trino in a Docker container:
docker run -d --name trino -p 8080:8080 trinodb/trino
-
Install the Trino ADBC driver:
dbc install trino
-
Customize the
mainmethod inExample.java- Change the connection arguments in the
params.put()calls- Format
uriaccording to the DSN (Data Source Name) format used by the Trino Go client, or keep it as is to use the TPC-H data included in the Trino Docker container image
- Format
- If you changed which Trino instance you're connecting to, also change the SQL SELECT statement in
stmt.setSqlQuery()
- Change the connection arguments in the
-
Run the Java program:
mvn compile exec:exec
-
Stop and remove the Docker container running Trino:
docker stop trino docker rm trino