jdbc syntax for timezone support
Posted by: David Garratt
Date: April 15, 2020 03:29PM

These connection strings both work. I found a number of examples on how to do this and I'm not 100% how to prove it.

jdbc:mysql://localhost:3306/mytestdatabase?serverTimezone=Europe/London#?connectTimeout=5&socketTimeout=0&autoReconnect=true

jdbc:mysql://localhost/mytestdatabase?serverTimezone=Europe/London#?connectTimeout=5&socketTimeout=0&autoReconnect=true

There is a # after the timezone which does not seem to cause a problem and a / within the timezone itself.

I tried multiple timezone strings when connecting to my local mysql database and it always seemed to connect.

If anyone has any comments on what I could do better or the significance of the # symbol it would be appreciated.

Should I be able to connect to my local mysql database if I'm specifying something other than Europe/London - as this is the default for my workstation

Thanks

Dave

Options: ReplyQuote


Subject
Written By
Posted
jdbc syntax for timezone support
April 15, 2020 03:29PM


Sorry, you can't reply to this topic. It has been closed.

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.