You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2001/09/01 18:18:41 UTC

cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/adapter DB.java

dlr         01/09/01 09:18:41

  Modified:    src/java/org/apache/torque/adapter DB.java
  Log:
  Forward-ported Fedor's change to date handling:
  
    "Implemented Gonzalo's suggestion to use JDBC escapes for dates. Seems to
    work well and solves all the inherent problems with dates."
  
  Revision  Changes    Path
  1.14      +4 -3      jakarta-turbine-torque/src/java/org/apache/torque/adapter/DB.java
  
  Index: DB.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DB.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -u -r1.13 -r1.14
  --- DB.java	2001/08/22 20:12:08	1.13
  +++ DB.java	2001/09/01 16:18:40	1.14
  @@ -59,6 +59,7 @@
   import java.sql.Connection;
   import java.sql.DriverManager;
   import java.sql.SQLException;
  +import java.sql.Timestamp;
   import javax.sql.ConnectionPoolDataSource;
   
   /**
  @@ -101,7 +102,7 @@
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  - * @version $Id: DB.java,v 1.13 2001/08/22 20:12:08 dlr Exp $
  + * @version $Id: DB.java,v 1.14 2001/09/01 16:18:40 dlr Exp $
    */
   public abstract class DB implements Serializable, IDMethod
   {
  @@ -402,7 +403,6 @@
          return '\'' + dateString + '\'';
       }
   
  -
       /**
        * This method is used to format any date string.
        * Database can use different default date formats.
  @@ -411,6 +411,7 @@
        */
       public String getDateString(Date date)
       {
  -       return '\'' + date.toString() + '\'';
  +        //return '\'' + date.toString() + '\'';
  +        return "{ts '" + new Timestamp(date.getTime()) + "'}";
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org