Received: from thatch2.compclass.com (thatch2.compclass.com [198.140.192.5]) by hub.org (8.9.3/8.9.3) with SMTP id NAA54628; Tue, 11 May 1999 13:18:15 -0400 (EDT) (envelope-from <@snapuser35.pacificcrest.net:andrew@compclass.com>) Received: from snapuser35.pacificcrest.net by thatch2.compclass.com id aa14217; 11 May 99 12:15 CDT Sender: andrew@compclass.com Message-ID: <37386522.B4491D51@compclass.com> Date: Tue, 11 May 1999 10:13:06 -0700 From: Andrew Merrill X-Mailer: Mozilla 4.08 [en] (X11; I; UnixWare 5 i386) MIME-Version: 1.0 To: pgsql-interfaces@hub.org, pgsql-patches@hub.org Subject: Patch for JDBC timezone problems Content-Type: multipart/mixed; boundary="------------7B79346F2328CBAC11ED8608" This is a multi-part message in MIME format. --------------7B79346F2328CBAC11ED8608 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The attached patch fixes the problems that the JDBC driver has with timezones in getTimestamp. The issues were described in an earlier post, this is just the patch. Andrew Merrill --------------7B79346F2328CBAC11ED8608 Content-Type: text/plain; charset=us-ascii; name="patch.jdbc" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.jdbc" *** ./src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java.orig Tue May 11 09:39:37 1999 --- ./src/interfaces/jdbc/postgresql/jdbc1/ResultSet.java Tue May 11 09:40:56 1999 *************** *** 438,449 **** if (s != null) { int TZ = new Float(s.substring(19)).intValue(); TZ = TZ * 60 * 60 * 1000; TimeZone zone = TimeZone.getDefault(); zone.setRawOffset(TZ); String nm = zone.getID(); ! s = s.substring(0,18) + nm; try { java.util.Date d = df.parse(s); return new Timestamp(d.getTime()); --- 438,451 ---- if (s != null) { + /* commented out by Andrew Merrill 5/1999 int TZ = new Float(s.substring(19)).intValue(); TZ = TZ * 60 * 60 * 1000; TimeZone zone = TimeZone.getDefault(); zone.setRawOffset(TZ); String nm = zone.getID(); ! s = s.substring(0,19) + nm; ! */ try { java.util.Date d = df.parse(s); return new Timestamp(d.getTime()); *** ./src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java.orig Tue May 11 09:41:14 1999 --- ./src/interfaces/jdbc/postgresql/jdbc2/ResultSet.java Tue May 11 09:42:16 1999 *************** *** 440,451 **** if (s != null) { int TZ = new Float(s.substring(19)).intValue(); TZ = TZ * 60 * 60 * 1000; TimeZone zone = TimeZone.getDefault(); zone.setRawOffset(TZ); String nm = zone.getID(); ! s = s.substring(0,18) + nm; try { java.util.Date d = df.parse(s); return new Timestamp(d.getTime()); --- 440,453 ---- if (s != null) { + /* commented out by Andrew Merrill 5/1999 int TZ = new Float(s.substring(19)).intValue(); TZ = TZ * 60 * 60 * 1000; TimeZone zone = TimeZone.getDefault(); zone.setRawOffset(TZ); String nm = zone.getID(); ! s = s.substring(0,19) + nm; ! */ try { java.util.Date d = df.parse(s); return new Timestamp(d.getTime()); --------------7B79346F2328CBAC11ED8608--