⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
Java (JDBC) Client

Installation To use the DuckDB Java (JDBC) client, visit the Java installation page.

The latest stable version of the DuckDB Java (JDBC) client is 1.5.5.

The DuckDB Java (JDBC) client lets Java applications query DuckDB through the standard JDBC API, extended with DuckDB-specific features for bulk loading, Apache Arrow interchange, user-defined functions, and profiling. This page covers installation; the other pages in this section cover connecting and each feature in detail.

Installation

The DuckDB Java JDBC API can be installed from Maven Central. Please see the installation page for details.

Tip To try features before they reach a stable release, preview (nightly) builds of the JDBC driver are published as SNAPSHOT versions to DuckDB's snapshot repository at https://duckdb-staging.duckdb.org/duckdb/duckdb-java/maven. This is an object storage repository with no browseable web page; it is consumed directly by Maven. Add the repository to your build and depend on a duckdb_jdbc SNAPSHOT version. See the preview builds page for a full Maven example.

Basic API Usage

DuckDB's JDBC API implements the main parts of the standard Java Database Connectivity (JDBC) API, version 4.1. Describing JDBC is beyond the scope of this page, see the official documentation for details. Below we focus on the DuckDB-specific parts.

Refer to the externally hosted API Reference for more information about our extensions to the JDBC specification, or the Arrow Methods.

Opening a Connection

In JDBC, database connections are created through the standard java.sql.DriverManager class, using the jdbc:duckdb: JDBC URL prefix:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

Connection conn = DriverManager.getConnection("jdbc:duckdb:");

Used on its own, jdbc:duckdb: opens an in-memory database. Appending a file name, for example jdbc:duckdb:/tmp/my_database, opens a persistent database instead.

To confirm that the driver is on the classpath and a connection can be opened, run a trivial query:

try (Statement stmt = conn.createStatement();
     ResultSet rs = stmt.executeQuery("SELECT 42")) {
    rs.next();
    System.out.println(rs.getInt(1)); // prints 42
}

Define Connections covers the connection lifecycle in full: the URL forms the driver accepts, DuckDB and driver configuration options, read-only mode, instance caching, threading, and shutdown.

Further Reading

  • Define Connections — the JDBC URL forms, configuration options, instance caching, threading, and connection shutdown.
  • Run Queries — sending queries with Statement and PreparedStatement, and reading DuckDB's nested types.
  • Import Data — bulk-loading data with the Appender and the JDBC batch writer.
  • Handle Results — Apache Arrow interchange, result streaming, and chunked results.
  • Clients Overview — the other client APIs DuckDB provides alongside JDBC.

Pages in This Section

© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog