Skip to content

Does clickhouse jdbc preparedstatement support set timestamp with nanoseconds?  #709

Closed

Description

@KaimingWan

clickhouse jdbc version: 0.3.1

The column type is datetime64(6) in my clickhouse table. I use the following code to set timestamp value. When I execute query I find the precision is not correct. Expected value is '2021-09-01 00:00:00.123456' and the actually value is '2021-09-01 00:00:00.123'.

value = '2021-09-01 00:00:00.123456'
pstmt.setObject(i, value);

Activity

  1. added this to the 0.3.2 Release milestone on Aug 30, 2021
  2. zhicwu commented on Aug 30, 2021

    @zhicwu
    Contributor

    Sorry it does not work well at this point. Please refer to discussion in #608.

  3. KaimingWan commented on Aug 30, 2021

    @KaimingWan
    Author

    @zhicwu Thanks, I will pay attention to the latest clickhouse driver.

  4. added
    legacy
    on Oct 6, 2021
  5. linked a pull request that will close this issueNew JDBC driver #747on Nov 29, 2021
  6. zhicwu commented on Dec 29, 2021

    @zhicwu
    Contributor

    Now it works in 0.3.2, but please consider to use setObject and LocalDateTime for better performance.

  7. added
    jdbc
    data-types
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdata-typesjdbclegacy

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions