Skip to content

[jdbc-v2] Potentially wrong encoding for java.sql.Date #2381

Closed

Description

@Onajk

Description

I have faced some type conversion problems during serializing java.sql.Date in jdbc-v2.
jdbc V2 converts java.sql.Date to java.time.Instant and serialise it using CH fromUnixTimestamp64Nano function which returns DateTime64 type but I was expecting Date.

Date is mapped into Instant but in if-else you could see branch for Date, isn't there a mistake?
https://github.com/ClickHouse/clickhouse-java/blob/main/jdbc-v2/src/main/java/com/clickhouse/jdbc/PreparedStatementImpl.java#L427

https://github.com/ClickHouse/clickhouse-java/blob/main/jdbc-v2/src/main/java/com/clickhouse/jdbc/PreparedStatementImpl.java#L746

Activity

  1. changed the title [-][jdbc-v2] Potentially wrong encoding for Instant[/-] [+][jdbc-v2] Potentially wrong encoding for java.sql.Date[/+] on May 22, 2025
  2. added
    jdbc
    on May 22, 2025
  3. added
    data-types
    on Jul 12, 2025
  4. chernser commented on Jul 12, 2025

    @chernser
    Contributor

    Good day, @Onajk !
    I think so, I will look into the problem.

  5. self-assigned this
    on Jul 24, 2025
  6. added this to the 0.9.3 milestone on Aug 20, 2025
  7. modified the milestones: 0.9.3, 0.9.2 on Sep 4, 2025
  8. modified the milestones: 0.9.3, 0.9.4 on Oct 29, 2025
  9. modified the milestones: 0.9.5, 0.9.6 on Jan 6, 2026
  10. modified the milestones: 0.9.6, 0.9.7 on Jan 21, 2026
  11. chernser commented on Feb 26, 2026

    @chernser
    Contributor

    Good day, @Onajk !

    Will be fixed in 0.9.7.
    Please also read our dedicate document about using date/time values #2381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdata-typesjdbc

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions