Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 6638 invoked from network); 25 Feb 2005 17:05:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Feb 2005 17:05:53 -0000 Received: (qmail 67876 invoked by uid 500); 25 Feb 2005 17:05:52 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 67861 invoked by uid 500); 25 Feb 2005 17:05:52 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 67847 invoked by uid 99); 25 Feb 2005 17:05:52 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from natnoddy.rzone.de (HELO natnoddy.rzone.de) (81.169.145.166) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 25 Feb 2005 09:05:50 -0800 Received: from gandalf (dsl-084-056-128-058.arcor-ip.net [84.56.128.58]) by post.webmailer.de (8.13.1/8.13.1) with ESMTP id j1PH5jRV003634 for ; Fri, 25 Feb 2005 18:05:46 +0100 (MET) From: "Joerg Friedrich" To: "'Apache Torque Developers List'" Subject: AW: Date and Timestamp problems Date: Fri, 25 Feb 2005 18:05:55 +0100 Message-ID: <000001c51b5c$44fefd30$6502a8c0@gandalf> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Thomas, you are right that MySQL works fine with the current implementation, = since it accepts the provided timestamp string even for date fields = (YYYY-MM-DD HH:MM:SS). The default implementation for the date formatting function = in the adapter is {ts ....}, which some database systems accept for = TIMESTAMP, but most likely not for DATE fields. In the case of Interbase/Firebird, = a query on DATE fields thus crashes.=20 There is a huge variety of what database systems accept as date and timestamp notation. My suggestion was to clearly distinguish, as SQL = does in the meantime, between DATE and TIMESTAMP types. In the case of = Interbase, I can only choose to patch Torque to support TIMESTAMP correctly, or to support DATE correctly, using the adapter function. I cannot cover both (unless of course I drop the time portion of a timestamp). The Oracle problem goes even a little deeper, since there are x versions = of Oracle JDBC drivers around which behave quite different regarding the = way they interpret DATE and TIMESTAMP. In the long run I think the safe way = to go would be to have DATE really just use the date portion, and TIMESTAMP date and time portion. Most database vendors that I have watched move = that way. Even MySQL which was quite tolerant in this matter has with their latest release begun to distinguish more clearly between these two SQL = data types. On another note, I have extended the DBFactory class and written a new adapter for the Firebird/Jaybird database based on the 3.1.1 release. = The current support for Interbase/Firebird is a little bit outdated. Are you interested in these files? If yes how should I submit them? Joerg -----Urspr=FCngliche Nachricht----- Von: Thomas Fischer [mailto:fischer@seitenbau.net]=20 Gesendet: Freitag, 25. Februar 2005 15:44 An: Apache Torque Developers List Betreff: RE: Date and Timestamp problems Hi Joerg, the only problem I am aware of is that Oracle Timestamps are not = supported at the moment (i.e. date is used instead, and rounded to day accuracy). There is already an open issue in scarab about this (http://issues.apache.org/scarab/issues/id/TRQS263), which will be = addressed in the next release. You can change the mapping from Date to timestamps = in the oracle db.props file if you want to fix it yourself. If you do that, timestamps have at least millisecond accuracy. I have heard that mysql timestamps are ok (at least millisec accurancy), correct me if I'm wrong. I do not know anything about interbase and MSSQL. Can you enlighten me = there ? Thomas J=F6rg Friedrich schrieb am 25.02.2005 = 14:59:20: > Hi, > > we have had problems with date fields and timestamps when working with = > different database systems. In our application we support for example=20 > Interbase, MySQL, Oracle and MS SQLServer. The adapter class of Torque = > as far as I could see has a method for the date format. However, there = > is no method for the timestamp format. This format may differ for=20 > different database systems/JDBC drivers. Would it be possible to add a = > suitable method > in a future release? > > Thanks. > > Joerg > > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org