5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 04:42:22 +08:00

Set default Oracle tz to GMT (safe default).

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149892 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Bayer 2011-07-22 20:03:44 +00:00
parent 7be68f8418
commit acba9c1aea

View File

@ -264,9 +264,13 @@ private void setSessionTimeZone(Connection conn) throws SQLException {
} catch (Exception ex) {
LOG.warn("Time zone " + clientTimeZone +
" could not be set on oracle database.");
LOG.info("Setting default time zone: UTC");
LOG.info("Setting default time zone: GMT");
try {
method.invoke(conn, "UTC");
// Per the documentation at:
// http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm#i637736
// The "GMT" timezone is guaranteed to exist in the available timezone
// regions, whereas others (e.g., "UTC") are not.
method.invoke(conn, "GMT");
} catch (Exception ex2) {
LOG.error("Could not set time zone for oracle connection", ex2);
// rethrow SQLException