MariaDB Connector/J introduced new DATETIME implementation in version 1.3.0 which breaks legacy code even though useLegacyDatetimeCode is set to true. Before, we have used version 1.1.8 in the following manner (simplified):
Thus, we instructed to always use UTC regardless of the server/client TimeZone. After upgrading to the version 1.4.2 the above-mentioned code stopped working even with useLegacyDatetimeCode set to true. This is rather obvious if we take a look at TimestampParameter source code:
As you can see, this code completely disregards calendar passed to it as a parameter (it saved in the constructor). As I see it, it is a breaking change.
If I set useLegacyDatetimeCode to false it will use server's time zone, which also is not a behavior we are trying to achieve.