Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 3FCEA9F96B6 for ; Sat, 10 Nov 2007 05:28:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 40269-02-2 for ; Sat, 10 Nov 2007 05:28:30 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id AAA5C9F96CC for ; Sat, 10 Nov 2007 05:28:50 -0400 (AST) Received: from 219-88-216-234.jetstream.xtra.co.nz ([219.88.216.234] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Iqmdw-0007Wh-Iu; Sat, 10 Nov 2007 22:28:44 +1300 Message-ID: <473579D8.3060600@opencloud.com> Date: Sat, 10 Nov 2007 22:28:56 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: =?UTF-8?B?6Zuo5qOu6YO35aSq6YOO?= CC: pgsql-jdbc@postgresql.org Subject: Re: Bug? report : PreparedStatement.setObject(java.util.Date) don't work References: <3a69fa320711090848n7d51dc57td54f23e0754679cb@mail.gmail.com> <473508F3.3050309@opencloud.com> <3a69fa320711092124hf008c72p471af0d968729c11@mail.gmail.com> In-Reply-To: <3a69fa320711092124hf008c72p471af0d968729c11@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200711/45 X-Sequence-Number: 17800 雨森郷太郎 wrote: > However, Is there reason to refrain from supporting java.util.Date ? Despite the name, java.util.Date actually contains both date and time information, and mapping it to SQL's DATE would silently lose data. That's why java.sql.Date exists in the first place: it's a deliberately limited subclass that explicitly only carries date information. We could map java.util.Date to TIMESTAMP, I suppose, but I think that'll cause even more confusion since there's also java.sql.Timestamp (that gives nanosecond precision vs. java.util.Date's millisecond precision). Most of the time, using java.util.Date with JDBC means you've got an application bug, and I don't think silently covering it up is a great idea. -O