empire-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1006355&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=1006355&r1=1006354&r2=1006355&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:43:15 2010
@@ -61,6 +61,7 @@ public class DBDatabaseDriverOracle exte
     }
     
     private boolean oracle8Compatibilty = false;
+
     private BooleanType booleanType = BooleanType.NUMBER;
 
     /**
@@ -73,6 +74,16 @@ public class DBDatabaseDriverOracle exte
         log.info("DBDatabaseDriverOracle created. Boolean Type is " + String.valueOf(booleanType));
     }
 
+    public boolean isOracle8Compatibilty()
+    {
+        return oracle8Compatibilty;
+    }
+
+    public void setOracle8Compatibilty(boolean oracle8Compatibilty)
+    {
+        this.oracle8Compatibilty = oracle8Compatibilty;
+    }
+
     public BooleanType getBooleanType()
     {
         return booleanType;
@@ -166,9 +177,9 @@ public class DBDatabaseDriverOracle exte
             case SQL_FUNC_CEILING:              return "ceil(?)";
             case SQL_FUNC_FLOOR:                return "floor(?)";
             // Date
-            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 ?)";
+            case SQL_FUNC_DAY:                  return oracle8Compatibilty ? "to_number(to_char(?,'DD'))"
  : "extract(day from ?)";
+            case SQL_FUNC_MONTH:                return oracle8Compatibilty ? "to_number(to_char(?,'MM'))"
  : "extract(month from ?)";
+            case SQL_FUNC_YEAR:                 return oracle8Compatibilty ? "to_number(to_char(?,'YYYY'))"
: "extract(year from ?)";
             // Aggregation
             case SQL_FUNC_SUM:                  return "sum(?)";
             case SQL_FUNC_MAX:                  return "max(?)";



Mime
View raw message