empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1006353 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
Date Sun, 10 Oct 2010 21:38:58 GMT
Author: doebele
Date: Sun Oct 10 21:38:57 2010
New Revision: 1006353

URL: http://svn.apache.org/viewvc?rev=1006353&view=rev
Log:
EMPIREDB-87

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java?rev=1006353&r1=1006352&r2=1006353&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
Sun Oct 10 21:38:57 2010
@@ -60,6 +60,7 @@ public class DBDatabaseDriverOracle exte
         NUMBER      // as NUMBER(1) with 1 for true and 0 for false
     }
     
+    private boolean oracle8Compatibilty = false;
     private BooleanType booleanType = BooleanType.NUMBER;
 
     /**
@@ -165,9 +166,9 @@ public class DBDatabaseDriverOracle exte
             case SQL_FUNC_CEILING:              return "ceil(?)";
             case SQL_FUNC_FLOOR:                return "floor(?)";
             // Date
-            case SQL_FUNC_DAY:                  return "TO_CHAR(?,'DD')";
-            case SQL_FUNC_MONTH:                return "TO_CHAR(?,'MM')";
-            case SQL_FUNC_YEAR:                 return "TO_CHAR(?,'YYYY')";
+            case SQL_FUNC_DAY:                  return oracle8Compatibilty ? "TO_CHAR(?,'DD')"
  : "extract(day from ?)";
+            case SQL_FUNC_MONTH:                return oracle8Compatibilty ? "TO_CHAR(?,'MM')"
  : "extract(month from ?)";
+            case SQL_FUNC_YEAR:                 return oracle8Compatibilty ? "TO_CHAR(?,'YYYY')"
: "extract(year from ?)";
             // Aggregation
             case SQL_FUNC_SUM:                  return "sum(?)";
             case SQL_FUNC_MAX:                  return "max(?)";



Mime
View raw message