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 BasicDataSource.java
Date Sun, 11 Jul 2004 16:51:34 GMT
dirkv       2004/07/11 09:51:34

  Modified:    dbcp/src/java/org/apache/commons/dbcp BasicDataSource.java
  Log:
  Bugzilla Bug 29963: BasicDataSource does not work with getConnection(String, String)
  - fail fast (throw UnsupportedOperationException)
  - update javadoc
  
  Revision  Changes    Path
  1.38      +7 -2      jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java
  
  Index: BasicDataSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- BasicDataSource.java	9 Jun 2004 18:21:23 -0000	1.37
  +++ BasicDataSource.java	11 Jul 2004 16:51:34 -0000	1.38
  @@ -543,6 +543,8 @@
   
       /**
        * Create (if necessary) and return a connection to the database.
  +     * 
  +     * <p><strong>BasicDataSource does NOT support this method.</strong></p>
        *
        * @param username Database user on whose behalf the Connection
        *   is being made
  @@ -551,7 +553,10 @@
        * @exception SQLException if a database access error occurs
        */
       public Connection getConnection(String username, String password) throws SQLException
{
  -        return createDataSource().getConnection(username, password);
  +        // This method isn't supported by the PoolingDataSource returned by
  +        // the createDataSource
  +        throw new UnsupportedOperationException("Not supported by BasicDataSource");
  +        // return createDataSource().getConnection(username, password);
       }
   
   
  
  
  

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