The mysql connector (JAVA) time zone is faulty
Posted by: songlin songlin
Date: February 12, 2025 03:21AM

Env
JVM: UTC
JDBC:serverTimezone=Asia/Shanghai (CST)
Mysql: UTC

When I use mysql-Connector -java version 8.0.32, I find that when I first query a LocalDateTime data, which is stored in mysql timestamp, the query will do time zone conversion. However, when I use the time zone converted data to update the mysql data directly, I do not do the time zone converted, so the data I update is 8h smaller than the original data
I didn't have this problem when I used version 8.0.22 or later

Options: ReplyQuote


Subject
Written By
Posted
The mysql connector (JAVA) time zone is faulty
February 12, 2025 03:21AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.