empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1522937 - in /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db: DBCommand.java oracle/DBCommandOracle.java
Date Fri, 13 Sep 2013 14:00:48 GMT
Author: doebele
Date: Fri Sep 13 14:00:48 2013
New Revision: 1522937

URL: http://svn.apache.org/r1522937
Log:
EMPIREDB-192
improvement

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCommand.java
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCommand.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCommand.java?rev=1522937&r1=1522936&r2=1522937&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCommand.java (original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBCommand.java Fri Sep 13
14:00:48 2013
@@ -266,19 +266,30 @@ public abstract class DBCommand extends 
         }
     }
     
+    /**
+     * returns true if prepared statements are enabled for this database
+     */
+    protected boolean isPreparedStatementsEnabled()
+    {
+        return db.isPreparedStatementsEnabled();
+    }
+    
+    /**
+     * returns true if a cmdParam should be used for the given column or false otherwise
+     */
     protected boolean useCmdParam(DBColumn col, Object value)
     {
         // Cannot wrap DBExpr or DBSystemDate
         if (value instanceof DBExpr || value instanceof DBDatabase.DBSystemDate)
             return false;
         // Check if prepared statements are enabled
-        if (db.isPreparedStatementsEnabled())
+        if (isPreparedStatementsEnabled())
             return true;
         // Only use a command param if column is of type BLOB or CLOB
         DataType dt = col.getDataType();
         return ( dt==DataType.BLOB || dt==DataType.CLOB );
     }
-
+    
     /**
      * Inserts DBSetExpr objects to the Vector 'set'.
      * 

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java?rev=1522937&r1=1522936&r2=1522937&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
(original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
Fri Sep 13 14:00:48 2013
@@ -157,7 +157,7 @@ public class DBCommandOracle extends DBC
         if (select == null)
             throw new ObjectNotValidException(this);
         // limit rows
-        boolean usePreparedStatements = getDatabase().isPreparedStatementsEnabled();
+        boolean usePreparedStatements = isPreparedStatementsEnabled();
         if (limitRows>=0)
         {   // add limitRows and skipRows wrapper
             buf.append("SELECT * FROM (");



Mime
View raw message