pg.ddx.io pgsql-interfaces@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Patch for JDBC timezone problems 3+ messages / 3 participants [nested] [flat]
* Patch for JDBC timezone problems @ 1999-05-11 17:13 Andrew Merrill <andrew@compclass.com> 0 siblings, 1 reply; 3+ messages in thread From: Andrew Merrill @ 1999-05-11 17:13 UTC (permalink / raw) To: pgsql-interfaces@hub.org; pgsql-patches@hub.org 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 Attachments:^ permalink raw reply [nested|flat] 3+ messages in threadpatch.jdbc (text/plain, 1.8K) download
*** ./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());
* Re: [PATCHES] Patch for JDBC timezone problems @ 1999-07-07 03:17 Bruce Momjian <maillist@candle.pha.pa.us> parent: Andrew Merrill <andrew@compclass.com> 0 siblings, 0 replies; 3+ messages in thread From: Bruce Momjian @ 1999-07-07 03:17 UTC (permalink / raw) To: Andrew Merrill <andrew@compclass.com>; +Cc: pgsql-interfaces@hub.org; pgsql-patches@hub.org This was never applied. Can someone tell me if it should be. Peter? > 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 > > *** ./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()); -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 ^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: [INTERFACES] Re: [PATCHES] Patch for JDBC timezone problems @ 1999-07-07 07:29 Peter Mount <petermount@it.maidstone.gov.uk> 0 siblings, 0 replies; 3+ messages in thread From: Peter Mount @ 1999-07-07 07:29 UTC (permalink / raw) To: 'Bruce Momjian' <maillist@candle.pha.pa.us>; Andrew Merrill <andrew@compclass.com>; +Cc: pgsql-interfaces@hub.org; pgsql-patches@hub.org I committed a patch for this some time ago. Check the JDBC CHANGELOG file, as I'm sure I mentioned it in there. Peter -- Peter Mount Enterprise Support Maidstone Borough Council Any views stated are my own, and not those of Maidstone Borough Council. -----Original Message----- From: Bruce Momjian [mailto:maillist@candle.pha.pa.us] Sent: 07 July 1999 04:17 To: Andrew Merrill Cc: pgsql-interfaces@hub.org; pgsql-patches@hub.org Subject: [INTERFACES] Re: [PATCHES] Patch for JDBC timezone problems This was never applied. Can someone tell me if it should be. Peter? > 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 > > *** ./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()); -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1999-07-07 07:29 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 1999-05-11 17:13 Patch for JDBC timezone problems Andrew Merrill <andrew@compclass.com> 1999-07-07 03:17 ` Bruce Momjian <maillist@candle.pha.pa.us> 1999-07-07 07:29 RE: [INTERFACES] Re: [PATCHES] Patch for JDBC timezone problems Peter Mount <petermount@it.maidstone.gov.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox