commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/cpdsadapter PooledConnectionImpl.java
Date Sun, 26 Oct 2003 17:35:30 GMT
dirkv       2003/10/26 09:35:30

  Modified:    dbcp/src/java/org/apache/commons/dbcp/cpdsadapter
                        PooledConnectionImpl.java
  Log:
  do not throw RuntimeExceptions
  
  Revision  Changes    Path
  1.10      +19 -23    jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
  
  Index: PooledConnectionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PooledConnectionImpl.java	9 Oct 2003 21:03:35 -0000	1.9
  +++ PooledConnectionImpl.java	26 Oct 2003 17:35:30 -0000	1.10
  @@ -300,28 +300,24 @@
        * {*link PreparedStatement}s.
        * @param obj the key for the {*link PreparedStatement} to be created
        */
  -    public Object makeObject(Object obj) {
  -        try {
  -            if (null == obj || !(obj instanceof PStmtKey)) {
  -                throw new IllegalArgumentException();
  +    public Object makeObject(Object obj) throws Exception {
  +        if (null == obj || !(obj instanceof PStmtKey)) {
  +            throw new IllegalArgumentException();
  +        } else {
  +            // _openPstmts++;
  +            PStmtKey key = (PStmtKey)obj;
  +            if (null == key._resultSetType 
  +                    && null == key._resultSetConcurrency) {
  +                return new PoolablePreparedStatementStub(
  +                        connection.prepareStatement(key._sql),
  +                        key, pstmtPool, connection);
               } else {
  -                // _openPstmts++;
  -                PStmtKey key = (PStmtKey)obj;
  -                if (null == key._resultSetType 
  -                        && null == key._resultSetConcurrency) {
  -                    return new PoolablePreparedStatementStub(
  -                            connection.prepareStatement(key._sql),
  -                            key, pstmtPool, connection);
  -                } else {
  -                    return new PoolablePreparedStatementStub(
  -                            connection.prepareStatement(key._sql,
  -                            key._resultSetType.intValue(),
  -                            key._resultSetConcurrency.intValue()),
  -                            key, pstmtPool, connection);
  -                }
  +                return new PoolablePreparedStatementStub(
  +                        connection.prepareStatement(key._sql,
  +                        key._resultSetType.intValue(),
  +                        key._resultSetConcurrency.intValue()),
  +                        key, pstmtPool, connection);
               }
  -        } catch (Exception e) {
  -            throw new RuntimeException(e.toString());
           }
       }
   
  
  
  

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


Mime
View raw message