You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JDBC: ResultSet.getObject(int, java.sql.Struct.class) fails for STRUCT column #900
For a STRUCT column, DuckDB JDBC reports org.duckdb.DuckDBStruct as the column class through ResultSetMetaData, which extends java.sql.Struct, but ResultSet.getObject(..., Struct.class) fails with a conversion error.
Reproduction
Create a table containing a STRUCT column:
CREATETABLEtest_table (
struct_col STRUCT(name VARCHAR, age INTEGER) NOT NULL
);
Execute a simple query:
SELECT struct_col FROM test_table;
The ResultSetMetaData reports:
Metadata
Value
getColumnName()
struct_col
getColumnTypeName()
STRUCT("name" VARCHAR, age INTEGER)
getColumnType()
2002 (java.sql.Types.STRUCT)
getColumnClassName()
org.duckdb.DuckDBStruct
DuckDBStruct implements java.sql.Struct.
However, attempting to retrieve the value using the standard JDBC typed getter:
java.sql.SQLException: Can't convert value to interface java.sql.Struct, SQL type: STRUCT
I am using ResultSet.getObject(index, Struct.class) because getStruct() is only exposed through the DuckDB-specific org.duckdb.DuckDBResultSet, rather than the standard java.sql.ResultSet interface.
Environment
DuckDB JDBC: 1.5.6.0
SQL type: STRUCT
Java type reported by metadata: org.duckdb.DuckDBStruct
changed the title [-]JDBC: ResultSet.getObject(int, Class) fails for STRUCT as java.sql.Struct[/-][+]JDBC: ResultSet.getObject(int, java.sql.Struct.class) fails for STRUCT column[/+]on Oct 8, 2026
Activity
[-]JDBC: ResultSet.getObject(int, Class) fails for STRUCT as java.sql.Struct[/-][+]JDBC: ResultSet.getObject(int, java.sql.Struct.class) fails for STRUCT column[/+]ResultSet enhancements
staticlibs commentedon Oct 20, 2026
Closing as fixed in #942
ResultSet enhancements (2.0)