Author: arminw
Date: Tue Aug 15 16:46:21 2006
New Revision: 431740

URL: http://svn.apache.org/viewvc?rev=431740&view=rev
Log:
fix, check for CallableStatement usage (on insert, update, delete) was too 
strict. It always expected that return values are used, this cause problems for 
all SP without return values (in these cases only a PreparedStmt instead of a 
CallableStmt was used --> error)

Modified:
    
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java

Modified: 
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java
URL: 
http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java?rev=431740&r1=431739&r2=431740&view=diff
==============================================================================
--- 
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java
 (original)
+++ 
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java
 Tue Aug 15 16:46:21 2006
@@ -83,16 +83,6 @@
         FORCEJDBC1_0 = level == 1.0;
     }
 
-    /**
-     * Answer true if a PreparedStatement has to be used
-     * <br>false for a CallableStatement
-     */
-    protected boolean usePreparedDeleteStatement()
-    {
-        return !(classDescriptor.getDeleteProcedure() != null &&
-                classDescriptor.getDeleteProcedure().hasReturnValues());
-    }
-
     public PreparedStatement getDeleteStmt(Connection con) throws SQLException
     {
         if (deleteSql == null)
@@ -130,16 +120,6 @@
         return stmt;
     }
 
-    /**
-     * Answer true if a PreparedStatement has to be used
-     * <br>false for a CallableStatement
-     */
-    protected boolean usePreparedInsertStatement()
-    {
-        return !(classDescriptor.getInsertProcedure() != null &&
-                classDescriptor.getInsertProcedure().hasReturnValues());
-    }
-
     public PreparedStatement getInsertStmt(Connection con) throws SQLException
     {
         if (insertSql == null)
@@ -195,16 +175,6 @@
         }
     }
 
-    /**
-     * Answer true if a PreparedStatement has to be used
-     * <br>false for a CallableStatement
-     */
-    protected boolean usePreparedUpdateStatement()
-    {
-        return !(classDescriptor.getUpdateProcedure() != null &&
-                classDescriptor.getUpdateProcedure().hasReturnValues());
-    }
-
     public PreparedStatement getUpdateStmt(Connection con) throws SQLException
     {
         if (updateSql == null)
@@ -433,4 +403,30 @@
         }
     }
 
+    /**
+     * Answer true if a PreparedStatement has to be used
+     * <br>false for a CallableStatement
+     */
+    protected boolean usePreparedInsertStatement()
+    {
+        return (classDescriptor.getInsertProcedure() == null);
+    }
+
+    /**
+     * Answer true if a PreparedStatement has to be used
+     * <br>false for a CallableStatement
+     */
+    protected boolean usePreparedUpdateStatement()
+    {
+        return (classDescriptor.getUpdateProcedure() == null);
+    }
+
+    /**
+     * Answer true if a PreparedStatement has to be used
+     * <br>false for a CallableStatement
+     */
+    protected boolean usePreparedDeleteStatement()
+    {
+        return (classDescriptor.getDeleteProcedure() == null);
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to