Return-Path: Delivered-To: apmail-incubator-empire-db-commits-archive@minotaur.apache.org Received: (qmail 38321 invoked from network); 10 Oct 2010 21:43:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Oct 2010 21:43:39 -0000 Received: (qmail 89041 invoked by uid 500); 10 Oct 2010 21:43:39 -0000 Delivered-To: apmail-incubator-empire-db-commits-archive@incubator.apache.org Received: (qmail 89023 invoked by uid 500); 10 Oct 2010 21:43:39 -0000 Mailing-List: contact empire-db-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-dev@incubator.apache.org Delivered-To: mailing list empire-db-commits@incubator.apache.org Received: (qmail 89015 invoked by uid 99); 10 Oct 2010 21:43:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Oct 2010 21:43:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 10 Oct 2010 21:43:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F3C3D23888E7; Sun, 10 Oct 2010 21:43:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: empire-db-commits@incubator.apache.org From: doebele@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101010214315.F3C3D23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(?)";