db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer StatementsForClassImpl.java
Date Mon, 06 Oct 2003 07:24:03 GMT
brj         2003/10/06 00:24:03

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        StatementsForClassImpl.java
  Log:
  fixed problem with CallableStatements
  
  Revision  Changes    Path
  1.18      +15 -7     db-ojb/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java
  
  Index: StatementsForClassImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/StatementsForClassImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- StatementsForClassImpl.java	9 Sep 2003 19:02:31 -0000	1.17
  +++ StatementsForClassImpl.java	6 Oct 2003 07:24:02 -0000	1.18
  @@ -135,6 +135,17 @@
           return false;
       }
   
  +    /**
  +     * Answer true if a PreparedStatement has to be used
  +     * <br>false for a CallableStatement 
  +     * @return
  +     */
  +    protected boolean usePreparedStatement()
  +    {
  +        return !((classDescriptor.getUpdateProcedure() != null) && 
  +                (classDescriptor.getUpdateProcedure().hasReturnValues()));
  +    }
  +
       public PreparedStatement getDeleteStmt(Connection con) throws SQLException
       {
           if (deleteSql == null)
  @@ -147,8 +158,7 @@
                   con,
                   deleteSql,
                   Query.NOT_SCROLLABLE,
  -                ((classDescriptor.getDeleteProcedure() != null)
  -                    && (classDescriptor.getDeleteProcedure().hasReturnValues())));
  +                usePreparedStatement());
           }
           catch (SQLException ex)
           {
  @@ -185,8 +195,7 @@
                   con,
                   insertSql,
                   Query.NOT_SCROLLABLE,
  -                ((classDescriptor.getInsertProcedure() != null)
  -                    && (classDescriptor.getInsertProcedure().hasReturnValues())));
  +                usePreparedStatement());
           }
           catch (SQLException ex)
           {
  @@ -240,8 +249,7 @@
                   con,
                   updateSql,
                   Query.NOT_SCROLLABLE,
  -                ((classDescriptor.getUpdateProcedure() != null)
  -                    && (classDescriptor.getUpdateProcedure().hasReturnValues())));
  +                usePreparedStatement());
           }
           catch (SQLException ex)
           {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message