Received: from ns.gcom.ru (Garant-Siberia-PostOffice.gcom.ru [194.84.180.33]) by hub.org (8.8.8/8.8.8) with ESMTP id EAA03677 for ; Mon, 19 Oct 1998 04:06:01 -0400 (EDT) (envelope-from avd@avd.garsib.ru) Received: (from uucp@localhost) by ns.gcom.ru (8.6.10/8.6.10) id OAA28569; Mon, 19 Oct 1998 14:02:12 +0600 Received: from avd.garsib.ru(194.135.7.80) via SMTP by Garant-Siberia-PostOffice.gcom.ru, id smtpd028566; Mon Oct 19 15:02:01 1998 Received: (from avd@localhost) by avd.garsib.ru (8.8.8/8.8.8) id PAA00948; Mon, 19 Oct 1998 15:13:11 +0700 (NSS) (envelope-from avd) To: Peter T Mount Cc: Herouth Maoz , pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] JDBC date problem References: From: Aleksey Demakov Date: 19 Oct 1998 15:13:05 +0700 In-Reply-To: Peter T Mount's message of Mon, 19 Oct 1998 06:44:13 +0100 (GMT) Message-ID: <871zo5dl65.fsf@avd.garsib.ru> Lines: 41 X-Mailer: Gnus v5.5/Emacs 20.2 Peter T Mount writes: > > > That is, if the column to contain the row creation date is of type > > DATETIME, just use now() instead of a ? and a setDate. > > > > INSERT INTO my_table > > (creation, other_field1, other_field2, other_field3) > > VALUES > > ('now', ?, ?, ?); > > > > Personally, I do this by defining the creation column as a NOT NULL and > > giving it a default (There's a bit of a trick here, because you have to use > > a function, or 'now' will be interpreted as the time of the creation of the > > table, so I define an SQL function which returns 'now'::DATETIME). This > > enables me to use a statement like > > > > INSERT INTO my_table > > (other_field1, other_field2, other_field3) > > VALUES > > (?,?,?); > > > > And not bother myself about the creation dates (which are automatic). > > This is a valid point, and for his case, I'd agree with you. Indeed, in my case this is much better solution. Many thanks to Herouth. > The Date problem is going to be with us as long as people are still using > pre 1.1.6 JDK's. Not quite. Also as long as people are using post 1.1.6 JDK's with the 6.3.2 driver. > I did think of making the driver sence if the bug is present, and then to > account for it, but decided against it, on the grounds of performance. As for me it's ok. -- Aleksey Demakov avd@gcom.ru