Skip to content

Prepared statement enhancements#199

Merged
staticlibs merged 1 commit intoduckdb:mainfrom
staticlibs:prepared_statement
Apr 22, 2025
Merged

Prepared statement enhancements#199
staticlibs merged 1 commit intoduckdb:mainfrom
staticlibs:prepared_statement

Conversation

@staticlibs
Copy link
Collaborator

This change implements a number of setter methods on PreparedStatement that were previously throwing
SQLFeatureNotSupportedException.

set*Stream group of methods is implemented only for compatibility with existing tools, no actual streaming is used on DB level - full input is read to string/bytes before passing it to DB.

execute/executeUpdate methods for generated keys are implemented only for cases when generated keys are not requested.

setTime/Date/Timestamp methods with Calendar (time zone) support are implemented fully following the same approach used before in #166. Also the logic for setTime method without Calendar is fixed to correctly NOT use default JVM time zone.

Testing: new tests added to cover implemented methods; timestamp tests are moved to separate file and time zone-specific tests are added.

Fixes: #195

This change implements a number of setter methods on
`PreparedStatement` that were previously throwing
`SQLFeatureNotSupportedException`.

`set*Stream` group of methods is implemented only for compatibility
with existing tools, no actual streaming is used on DB level - full
input is read to string/bytes before passing it to DB.

`execute`/`executeUpdate` methods for generated keys are implemented
only for cases when generated keys are not requested.

`setTime/Date/Timestamp` methods with `Calendar` (time zone) support
are implemented fully following the same approach used before in duckdb#166.
Also the logic for `setTime` method without `Calendar` is fixed to
correctly NOT use default JVM time zone.

Testing: new tests added to cover implemented methods; timestamp tests
are moved to separate file and time zone-specific tests are added.

Fixes: duckdb#195
@staticlibs staticlibs merged commit 239f150 into duckdb:main Apr 22, 2025
7 checks passed
@staticlibs staticlibs deleted the prepared_statement branch April 22, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataGrip persisting a timestamp produces java.sql.SQLException: setTimestamp

1 participant