⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 8 of about 8 for getConnection (0.002 sec.)
Connect 13085
Overview Every DuckDB feature reachable from Java starts with a Connection . This page covers the JDBC URL forms the driver accepts, how DuckDB and driver options are passed and which of them win, how connections come to share (or not share ... force registration before opening a connection: Class.forName("org.duckdb.DuckDBDriver"); Connection conn = DriverManager.getConnection("jdbc:duckdb:"); In GraalVM Native Image executables, always use this explicit load: the service-provider discovery is not ... ckdb: JDBC URL prefix, like so: import java.sql.Connection; import java.sql.DriverManager; Connection conn = DriverManager.getConnection("jdbc:duckdb:"); To use DuckDB-specific features such as the Appender , cast the object to a DuckDBConnection : import jav ... a.sql.DriverManager; import org.duckdb.DuckDBConnection; DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); Additional connections can be created using the DriverManager . The DuckDBConnection#duplicate() method o ...
https://man.mtool.work/duckdb/2.0/clients/java/connecting.html
Handle Results 10194
Overview Beyond the standard JDBC ResultSet , the DuckDB driver can hand results to Apache Arrow , stream large results instead of materializing them, and expose raw columnar data chunks. This page covers each of these result-handling optio ... llocator; import org.apache.arrow.vector.ipc.ArrowReader; import org.duckdb.DuckDBResultSet; try (var conn = DriverManager.getConnection("jdbc:duckdb:"); var stmt = conn.prepareStatement("SELECT * FROM generate_series(2000)"); var resultset = (DuckDBResultSet ... exportArrayStream(allocator, reader, arrow_array_stream); // DuckDB setup try (var conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:")) { conn.registerArrowStream("asdf", arrow_array_stream); // run a query try (var stmt = conn.createStateme ... w Properties(); props.setProperty(DuckDBDriver.JDBC_STREAM_RESULTS, String.valueOf(true)); Connection conn = DriverManager.getConnection("jdbc:duckdb:", props); Chunked Results The JDBC driver can return a query result as a lazily fetched sequence of columnar ...
https://man.mtool.work/duckdb/2.0/clients/java/result_handling.html
Profile and Monitor 9434
Overview The JDBC driver exposes several ways to observe a running or completed query: cancelling and timing out queries, polling query progress, retrieving profiling output, and emitting memory-usage events through Java Flight Recorder . T ... db.DuckDBPreparedStatement; import org.duckdb.QueryProgress; try (DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); DuckDBPreparedStatement ps = (DuckDBPreparedStatement) conn.prepareStatement("SELECT count(*) FROM range( ... , NO_OUTPUT , JSON , HTML , GRAPHVIZ , YAML , and MERMAID . try (DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); Statement stmt = conn.createStatement()) { stmt.execute("SET enable_profiling = 'json'"); stmt.executeQue ... ops = new Properties(); props.setProperty("jdbc_jfr_memory_monitor", "analytics-db"); try (Connection conn = DriverManager.getConnection("jdbc:duckdb:/tmp/my_database", props)) { // work with the connection while a JFR recording is active } The same option ca ...
https://man.mtool.work/duckdb/2.0/clients/java/profiling.html
Import Data 8657
Overview The JDBC driver offers two ways to load data into DuckDB in bulk: the high-performance Appender and a JDBC batch writer. This page describes both and when to use each. Appender The Appender is available in the DuckDB JDBC driver vi ... mport java.sql.DriverManager; import org.duckdb.DuckDBConnection; DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); try (var stmt = conn.createStatement()) { stmt.execute("CREATE TABLE tbl (x INTEGER, y DOUBLE, s VARCHAR) ... t java.sql.PreparedStatement; import org.duckdb.DuckDBConnection; DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); PreparedStatement stmt = conn.prepareStatement("INSERT INTO test (x, y, z) VALUES (?, ?, ?);"); stmt.setO ... r; import java.sql.Statement; import org.duckdb.DuckDBConnection; DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); Statement stmt = conn.createStatement(); stmt.execute("CREATE TABLE test (x INTEGER, y INTEGER, z INTEGER ...
https://man.mtool.work/duckdb/2.0/clients/java/data_import.html
Write User Defined Functions 8368
Overview The JDBC driver can register user-defined functions (UDFs) written in Java, including scalar functions and table functions. This page covers building and registering both, from the simple functional-interface overloads to the vecto ... ava.sql.Connection; import java.sql.DriverManager; import org.duckdb.DuckDBFunctions; try (Connection conn = DriverManager.getConnection("jdbc:duckdb:")) { DuckDBFunctions.scalarFunction() .withName("java_add_one") .withParameter(int.class) .withReturnType(in ... DBColumnType; import org.duckdb.DuckDBFunctions; import org.duckdb.DuckDBLogicalType; try (Connection conn = DriverManager.getConnection("jdbc:duckdb:"); DuckDBLogicalType intType = DuckDBLogicalType.of(DuckDBColumnType.INTEGER)) { DuckDBFunctions.scalarFunct ... is is the scalar-function counterpart to reading query results with chunked results . try (Connection conn = DriverManager.getConnection("jdbc:duckdb:"); DuckDBLogicalType tsType = DuckDBLogicalType.of(DuckDBColumnType.TIMESTAMP); DuckDBLogicalType strType = ...
https://man.mtool.work/duckdb/2.0/clients/java/functions.html
Troubleshoot 8061
Overview This page collects common issues encountered when using the DuckDB JDBC driver, together with their workarounds. If you run into a problem that is not covered here, search the driver's issue tracker on GitHub. Driver Class Not Foun ... ption in thread "main" java.sql.SQLException: No suitable driver found for jdbc:duckdb: at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:706) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:252) ... And when trying to lo ...
https://man.mtool.work/duckdb/2.0/clients/java/troubleshoot.html
Run Queries 7284
Overview Java applications send queries and read result sets through the familiar Statement , PreparedStatement , and ResultSet interfaces. This page covers sending queries and reading DuckDB's nested and composite types. For opening the Co ... tion; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; Connection conn = DriverManager.getConnection("jdbc:duckdb:"); // create a table Statement stmt = conn.createStatement(); stmt.execute("CREATE TABLE items (item VARCHAR ... Struct; import java.util.Map; import org.duckdb.DuckDBConnection; DuckDBConnection conn = (DuckDBConnection) DriverManager.getConnection("jdbc:duckdb:"); // LIST / ARRAY Array list = conn.createArrayOf("INTEGER", new Object[] {1, 2, 3}); try (PreparedStatemen ...
https://man.mtool.work/duckdb/2.0/clients/java/querying.html
Java (JDBC) Client 7139
Installation To use the DuckDB Java (JDBC) client, visit the Java installation page . The latest stable version of the DuckDB Java (JDBC) client is 2.0.0. The DuckDB Java (JDBC) client lets Java applications query DuckDB through the standar ... tion; 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 ...
https://man.mtool.work/duckdb/2.0/clients/java/overview.html
PREV 1 NEXT
DuckDB 2.0 Documentation / man.mtool.work