ODBC and JDBC Connectors
DuckDB publishes official connector drivers so desktop BI tools, spreadsheet applications, and Java codebases can open DuckDB databases over standard protocols.
ODBC Driver
Download the ODBC driver from the DuckDB releases page and install it with its script:
cd duckdb-odbc-1.1.3
./install.sh --prefix /usr/local
isql -v "Driver=/usr/local/lib/duckdbodbc.so;Database=/data/mydb.duckdb" -t
SELECT count(*) FROM events;
Tools that speak ODBC (DBeaver, DataGrip, Excel, Metabase) can then use a connection string that points at the .duckdb file, or use the :memory: database.
JDBC Driver
The JDBC driver is published on Maven Central:
<dependency>
<groupId>org.duckdb</groupId>
<artifactId>duckdb_jdbc</artifactId>
<version>1.1.3</version>
</dependency>
import java.sql.*;
public class Demo {
public static void main(String[] args) throws Exception {
Connection con = DriverManager.getConnection("jdbc:duckdb:/data/mydb.duckdb");
ResultSet rs = con.createStatement().executeQuery("SELECT count(*) FROM events");
if (rs.next()) {
System.out.println(rs.getLong(1));
}
}
}
Practical Notes
- Because DuckDB is in-process, the driver runs inside the client tool and reads the file directly; no server is required.
- Point multiple tools at the same file in read-only mode for safe concurrent access.
- For shared analysis, export to Parquet and let each tool read the immutable file.
Summary
The official ODBC and JDBC drivers let BI tools and Java applications open DuckDB files through standard connection strings. Install the ODBC driver for desktop tools, add the duckdb_jdbc dependency for Java, and use read-only connections when several consumers share one database file.