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:[EMAIL PROTECTED]";>Jon S. Stevens</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Brett McLaughlin</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to