question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SetDate can not work

See original GitHub issue

When I use setDate method in ClickHousePreparedStatementImpl like below

statement_1.setDate(19, new Date(System.currentTimeMillis()));

It throw a exception and tell me garbage after DateTime('America/Phoenix'): "08<TAB>9169210"

and I change to statement_1.setString(19, "1970-01-01 16:00:00"); it can work success

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
zhicwucommented, Dec 29, 2021

Now the new driver uses RowBinary format instead of TabSeparated so it should work. I don’t have a full example to verify but in general it’s better to use java.time.LocalDate instead of java.sql.Date, and use PreparedStatement.setObject to set parameter.

0reactions
zhicwucommented, Apr 14, 2021

Thanks for the extra information. I thought the driver only has issue with 21.3 but looks like it has problem with 21.2 too. I believe there’s issue introduced on server side causing the problem, but I’ll fix this by replacing text-based format to binary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery UI Datepicker - setDate not working - Stack Overflow
1 Answer 1 ... You have to initialize the datepicker first: $('#datepicker').datepicker();. When you pass setDate, you are calling a method which ...
Read more >
jQuery UI Datepicker - setDate not working - YouTube
jQuery : jQuery UI Datepicker - setDate not working [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] jQuery : jQuery UI ...
Read more >
Date.prototype.setDate() - JavaScript - MDN Web Docs - Mozilla
The setDate() method changes the day of the month of a given Date instance, based on local time. To instead change the day...
Read more >
JavaScript Date setDate() Method - W3Schools
setDate () sets the day of the month of a date. Example 2. Set the day of the month to the last day...
Read more >
Synchronization from a set date, don't work
(We are OK with everything {apparently}, but the sync doesnt work). We try to synchronize from a more updated date, using the option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found