JDBC Timezone Bug Fix

There’s a bug when trying to use

JDBC_DRIVER = “com.mysql.cj.jdbc.Driver”

It states that “The server time zone value ‘PDT’ is unrecognized or represents more than one time zone. ” It could also be a timezone other than ‘PDT’.

The Fix

import java.util.TimeZone;

Define your DB_URL with a query string defining serverTimezone as follows replacing your url if different from example below.

static final String DB_URL = “jdbc:mysql://localhost/?serverTimezone=” + TimeZone.getDefault().getID();