Re: Error when setting useTimezone=true
Posted by: Mark Matthews
Date: August 22, 2005 10:11AM

Paul Darling wrote:
> I overlooked some log4j data that provides the
> stackof the original problem, that lead to the
> ExceptionInInitializeError:-
>
> 2005-08-22 05:25:32,394 ERROR
> com.tumbleweed.mg.database.DBPropertyMap - DB
> Connection problem or Error executing query:
> "SELECT name,value FROM local_settings"
> java.sql.SQLException: The server timezone value
> 'PDT' represents more than one timezone. You must
> configure either the server or client to use a
> more specifc timezone value if you want to enable
> timezone support. The timezones that 'PDTmaps to
> are: America/Los_Angeles, America/Juneau,
> America/Boise, America/Vancouver,
> America/Dawson_Creek, America/Inuvik,
> America/Whitehorse, America/Dawson,
> America/Tijuana
> at
> com.mysql.jdbc.Connection.configureTimezone(Connec
> tion.java:3127)
> at
> com.mysql.jdbc.Connection.initializePropsFromServe
> r(Connection.java:3252)
> at
> com.mysql.jdbc.Connection.createNewIO(Connection.j
> ava:1780)
> at
> com.mysql.jdbc.Connection.<init>(Connection.
> java:430)
> at
> com.mysql.jdbc.NonRegisteringDriver.connect(NonReg
> isteringDriver.java:268)
> at
> java.sql.DriverManager.getConnection(DriverManager
> .java:512)
> at
> java.sql.DriverManager.getConnection(DriverManager
> .java:193)
> at
> org.apache.commons.dbcp.DriverManagerConnectionFac
> tory.createConnection(DriverManagerConnectionFacto
> ry.java:46)
>
> So the problem appears to be that PDT is the
> configured MySQL timezone and the driver cannot
> use this as it's ambiguous.
>
> The solution therefore seems to be to ensure that
> the timezone is initialized (and reset using only)
> an unambiguous timezone. Is this correct? Is
> this a common problem, as I would expect PDT (and
> similar) to be a commonly configured timezone.
>
> Paul


Paul,

The issue is that there is more than one timezone that maps to the abreviation "PDT". I'm not sure about PDT, but there are many common timezone abbreviations that _aren't_ actually the same timezone at all (and not even on the same continent) . Java requires you to use timezones like "America/Los Angeles" (i.e. posix-like timezones) to remove that ambiguity.

If you want to use "PDT" as your server timezone, then you should configure the driver via serverTimezone=America/Los Angeles or similar.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: Error when setting useTimezone=true
August 22, 2005 10:11AM


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.