db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer ConnectionFactoryDBCPImpl.java
Date Sun, 23 May 2004 16:36:53 GMT
brianm      2004/05/23 09:36:53

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        ConnectionFactoryDBCPImpl.java
  Log:
  Better error reporting and exception handling patch submitted by Robert Sfeir
  Submitted by:	Robert Sfeir
  
  Revision  Changes    Path
  1.10      +14 -4     db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java
  
  Index: ConnectionFactoryDBCPImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ConnectionFactoryDBCPImpl.java	4 Apr 2004 23:53:30 -0000	1.9
  +++ ConnectionFactoryDBCPImpl.java	23 May 2004 16:36:53 -0000	1.10
  @@ -94,17 +94,27 @@
       /**
        * Override this method to setup your own pool
        */
  -    protected DataSource setupPool(JdbcConnectionDescriptor jcd) throws Exception
  +    protected DataSource setupPool(JdbcConnectionDescriptor jcd)
       {
           log.info("Create new DBCP connection pool:" + jcd);
  +
           try
           {
               ClassHelper.newInstance(jcd.getDriver());
           }
  -        catch (Exception e)
  +        catch (InstantiationException e)
           {
  -            log.error("Could not instantiate jdbc driver", e);
  +            log.fatal("Unable to instantiate the driver class: " + jcd.getDriver() + "
in ConnectionFactoryDBCImpl!" , e);
           }
  +        catch (IllegalAccessException e)
  +        {
  +            log.fatal("IllegalAccessException while instantiating the driver class: " +
jcd.getDriver() + " in ConnectionFactoryDBCImpl!" , e);
  +        }
  +        catch (ClassNotFoundException e)
  +        {
  +            log.fatal("Could not find the driver class : " + jcd.getDriver() + " in ConnectionFactoryDBCImpl!"
, e);
  +        }
  +
   
           // get the configuration for the connection pool
           GenericObjectPool.Config conf = jcd.getConnectionPoolDescriptor().getObjectPoolConfig();
  
  
  

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