[CONJ-65] implement serverTimezone JDBC connection string parameter Created: 2013-09-18  Updated: 2016-01-05  Resolved: 2013-09-20

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.5
Fix Version/s: 1.1.6

Type: Task Priority: Major
Reporter: Mikhail Olkhovskiy Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File patch.txt    
Issue Links:
Relates
relates to CONJ-143 ResultSet.getTime() shouldn't convert... Closed

 Description   

I suggest to implement JDBC connection string parameter serverTimezone.
This parameter will specify timezone during parsing and formatting Date, Time, Timestamp values.
MySQL Connector/J has this parameter http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html

I have tried to implement this feature. In attachment you can find patch.



 Comments   
Comment by Vladislav Vaintroub [ 2013-09-19 ]

Would not "time_zone" server session variable be a viable alternative? If not, why not?

Comment by Vladislav Vaintroub [ 2013-09-19 ]

Also, JDBC provides several ResultSet.getXXX methods that have Calendar parameter (getDate.getTime,getTimestamp),and PreparedStatement has corresponding setXXX methods.
Would not using this methods be a viable alternative?

Comment by Mikhail Olkhovskiy [ 2013-09-19 ]

We store dates in DATETIME
Time zone effects only TIMESTAMP. (https://mariadb.com/kb/en/time-zones/)

Comment by Mikhail Olkhovskiy [ 2013-09-19 ]

Yes, It is possible to use setXXX methods with Calendar. But we use ORM (EclipseLink) and we need to write adapter for MariaDB JDBC to call setXX methods with Calendar.
I thought, it is better to implement parameter from MySQL Connector/J.

Generated at Thu Feb 08 03:12:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.