db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/util/batch BatchConnection.java
Date Sat, 13 Mar 2004 14:30:41 GMT
olegnitz    2004/03/13 06:30:41

  Modified:    src/java/org/apache/ojb/broker/util/batch
                        BatchConnection.java
  Log:
  Workaround for the bug in proxy.jar used with JDK 1.2:
  methods from superclasses of given interfaces are not implemented
  
  Revision  Changes    Path
  1.17      +5 -2      db-ojb/src/java/org/apache/ojb/broker/util/batch/BatchConnection.java
  
  Index: BatchConnection.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/batch/BatchConnection.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- BatchConnection.java	11 Mar 2004 18:16:15 -0000	1.16
  +++ BatchConnection.java	13 Mar 2004 14:30:41 -0000	1.17
  @@ -20,6 +20,7 @@
   
   import java.sql.Connection;
   import java.sql.PreparedStatement;
  +import java.sql.Statement;
   import java.sql.SQLException;
   import java.util.ArrayList;
   import java.util.Collection;
  @@ -266,8 +267,10 @@
               PreparedStatement stmt = (PreparedStatement) _statements.get(sql);
               if (stmt == null)
               {
  +                // [olegnitz] for JDK 1.2 we need to list both PreparedStatement and Statement
  +                // interfaces, otherwise proxy.jar works incorrectly
                   stmt = (PreparedStatement) Proxy.newProxyInstance(getClass().getClassLoader(),
  -                        new Class[]{PreparedStatement.class, BatchPreparedStatement.class},
  +                        new Class[]{PreparedStatement.class, Statement.class, BatchPreparedStatement.class},
                           new PreparedStatementInvocationHandler(this, sql, m_jcd));
                   _statements.put(sql, stmt);
               }
  
  
  

---------------------------------------------------------------------
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