Using the global `TimeZone` config in the `Properties` object passed to `DriverManager.getConnection` fails with error: "The following options were not recognized: TimeZone"

Open
#417 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, scala
Domain
database

Research direction

Start with DuckDBDriver.java and DuckDBConnection.java, following the DriverManager.getConnection path into the native startup shown in the stack trace. Compare the Properties handling with DuckDB’s global configuration documentation and reproduce the Scala example using TimeZone. Done means the documented global timezone can be passed through Properties without the unrecognized-option error, with coverage for the connection path.

Written by the indexing model from the issue text.

Description

This error seems counter-intuitive as this config is documented as global: https://duckdb.org/docs/stable/configuration/overview.html#global-configuration-options

Shouldn't this Properties object allow us to configure the global timezone of our statements?

Reproducer (scala code):

val config = new Properties()
config.put("TimeZone", "UTC")
DriverManager.getConnection(url, config).unwrap(classOf[DuckDBConnection])

Error:

        java.sql.SQLException: Invalid Input Error: The following options were not recognized: TimeZone
        	at org.duckdb.DuckDBNative.duckdb_jdbc_startup(Native Method)
        	at org.duckdb.DuckDBConnection.newConnection(DuckDBConnection.java:62)
        	at org.duckdb.DuckDBDriver.connect(DuckDBDriver.java:114)
        	at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:683)
        	at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:191)
        	...

cc @guizmaii

Dominant language
C++
Stars
127
Forks
80
Avg merge
13h 41m
Merged PRs (30d)
44

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from duckdb/duckdb-java

All issues in duckdb/duckdb-java

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.