User: thedug  
  Date: 01/11/09 09:51:16

  Modified:    src/main/org/jboss/pool/jdbc Tag: Branch_2_4
                        ConnectionInPool.java
  Log:
  Changed prepareStatment() to not throw away the resultSetType and 
resultSetConcurrenty.
  
  Now passes them through to conn.prepareStatement(sql, type, conncurrency)
  
  Moved cache logic to the prepareStatement(sql, type, conncurrency) method
  and called through from the prepareSatement(sql) method.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.1 +25 -18    
jbosspool/src/main/org/jboss/pool/jdbc/Attic/ConnectionInPool.java
  
  Index: ConnectionInPool.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosspool/src/main/org/jboss/pool/jdbc/Attic/ConnectionInPool.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- ConnectionInPool.java     2001/05/15 07:58:24     1.1.1.1
  +++ ConnectionInPool.java     2001/11/09 17:51:15     1.1.1.1.2.1
  @@ -240,23 +240,7 @@
       }
   
       public PreparedStatement prepareStatement(String sql) throws SQLException {
  -        if(con == null) throw new SQLException(CLOSED);
  -        try {
  -            PreparedStatementInPool wrapper = null;
  -            if(preparedStatementCacheSize >= 0) {
  -                PreparedStatement ps = 
(PreparedStatement)preparedStatementCache.useObject(sql);
  -                if(ps == null)
  -                    throw new SQLException("Unable to create PreparedStatement!");
  -                wrapper = new PreparedStatementInPool(ps, this, sql);
  -            } else {
  -                wrapper = new PreparedStatementInPool(con.prepareStatement(sql), 
this, sql);
  -            }
  -            statements.add(wrapper);
  -            return wrapper;
  -        } catch(SQLException e) {
  -            setError(e);
  -            throw e;
  -        }
  +        return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, 
ResultSet.CONCUR_READ_ONLY);
       }
   
       public CallableStatement prepareCall(String sql) throws SQLException {
  @@ -437,9 +421,32 @@
           }
       }
   
  +
       public PreparedStatement prepareStatement(String sql, int resultSetType, int 
resultSetConcurrency) throws SQLException {
  -        return prepareStatement(sql);
  +        if(con == null) throw new SQLException(CLOSED);
  +        try {
  +            PreparedStatementInPool wrapper = null;
  +            if(preparedStatementCacheSize >= 0) {
  +                PreparedStatement ps = 
(PreparedStatement)preparedStatementCache.useObject(sql);
  +                if(ps == null)
  +                    throw new SQLException("Unable to create PreparedStatement!");
  +                wrapper = new PreparedStatementInPool(ps, this, sql);
  +            } else {
  +                wrapper = new PreparedStatementInPool(con.prepareStatement(sql, 
resultSetType, resultSetConcurrency), this, sql);
  +            }
  +            statements.add(wrapper);
  +            return wrapper;
  +        } catch(SQLException e) {
  +            setError(e);
  +            throw e;
  +        }
       }
  +
  +    /*
  +      public PreparedStatement prepareStatement(String sql, int resultSetType, int 
resultSetConcurrency) throws SQLException {
  +      return prepareStatement(sql);
  +      }
  +    */
   
       public CallableStatement prepareCall(String sql, int resultSetType, int 
resultSetConcurrency) throws SQLException {
           if(con == null) throw new SQLException(CLOSED);
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to