Skip to content

Commit 3696a80

Browse files
sgrebnovJeadiephillipleblanc
authored
Document JDBC API (#385)
* Document JDBC API * Fix clients/tableau link * Apply suggestions from code review Co-authored-by: Phillip LeBlanc <phillip@spiceai.io> * Update index.md --------- Co-authored-by: Jack Eadie <jack@spice.ai> Co-authored-by: Phillip LeBlanc <phillip@spiceai.io>
1 parent 053164c commit 3696a80

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

spiceaidocs/docs/api/jdbc/index.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: 'JDBC: Java Database Connectivity'
3+
sidebar_label: 'JDBC'
4+
sidebar_position: 2
5+
description: 'JDBC API Documentation'
6+
pagination_prev: null
7+
pagination_next: null
8+
---
9+
10+
[JDBC](https://docs.oracle.com/javase/tutorial/jdbc/basics/index.html) (Java Database Connectivity) is a standard API for connecting to and interacting with databases.
11+
12+
Spice supports JDBC clients through a JDBC driver implementation based on the [Flight SQL](https://arrow.apache.org/docs/format/FlightSql.html) protocol. This enables any JDBC-compatible application to connect to Spice, execute queries, and retrieve data.
13+
14+
## Download and install the Flight SQL JDBC driver
15+
16+
### Download the Flight SQL JDBC driver
17+
18+
- Find the appropriate [Flight SQL JDBC driver](https://central.sonatype.com/artifact/org.apache.arrow/flight-sql-jdbc-driver/versions) version.
19+
- Click **Browse** next to the version you want to download
20+
- Click the `flight-sql-jdbc-driver-XX.XX.XX.jar` file (with only the `.jar` file extension) from the list of files to download the driver jar file
21+
22+
### Add the driver to your application
23+
24+
Follow the instructions specific to your application for adding a custom JDBC driver. Examples:
25+
26+
**Tableau**:
27+
- Windows: `C:\Program Files\Tableau\Drivers`
28+
- Mac: `~/Library/Tableau/Drivers`
29+
- Linux: `/opt/tableau/tableau_driver/jdbc` - Start or restart Tableau
30+
31+
[Full instruction](/clients/tableau)
32+
33+
**JetBrains DataGrip**:
34+
35+
- In Database Explorer menu, select "+" and choose "Driver"
36+
- Follow the steps to add the JDBC `.jar` file
37+
38+
[Full instruction](/clients/jetbrains-datagrip)
39+
40+
**DBeaver**:
41+
42+
- In the DBeaver application menu bar, open the "Database" menu and choose: "Driver Manager"
43+
- Click the "New" button and follow instructions to add JDBC `.jar` file.
44+
45+
[Full instruction](/clients/DBeaver)
46+
47+
## Configure JDBC connection
48+
49+
1. Use the following configuration settings:
50+
51+
- **URL**: `jdbc:arrow-flight-sql://{host}:{port}`
52+
- **Dialect**: `PostgreSQL`
53+
54+
For example:
55+
<img width="400" src="/img/tableau/tableau-jdbc-conn.png"/>
56+
57+
1. **Ensure Spice is running**
58+
1. Click **Connect**
59+
60+
Note: Spice has [TLS support](/api/tls). For testing or non-production use cases for Spice without TLS, the following JDBC connection URL will bypass TLS `jdbc:arrow-flight-sql://{host}:{port}?useEncryption=false&disableCertificateVerification=true`.
61+
62+
## Execute Test Query
63+
64+
In the configured application, run a sample query, such as `SELECT * FROM taxi_trips;`
65+
66+
![Query Results](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/0e9f3c0f-2e03-47f9-8d5e-65e078d7e900/public "Query Results")

0 commit comments

Comments
 (0)